gil pushed to glassfish-hk2 (master). "fix failure on directory creation"

notifications at fedoraproject.org notifications at fedoraproject.org
Tue May 26 20:09:24 UTC 2015


From 4945b19502ce66a08f534a09fa9ce5bd16be28df Mon Sep 17 00:00:00 2001
From: gil <puntogil at libero.it>
Date: Tue, 26 May 2015 22:08:34 +0200
Subject: fix failure on directory creation


diff --git a/glassfish-hk2-2.4.0-b24-AbstractConfigGeneratorMojo.patch b/glassfish-hk2-2.4.0-b24-AbstractConfigGeneratorMojo.patch
new file mode 100644
index 0000000..3d0f582
--- /dev/null
+++ b/glassfish-hk2-2.4.0-b24-AbstractConfigGeneratorMojo.patch
@@ -0,0 +1,24 @@
+--- hk2-hk2-parent-2.4.0-b24/hk2-configuration/persistence/hk2-xml-dom/config-generator/src/main/java/org/jvnet/hk2/config/generator/maven/AbstractConfigGeneratorMojo.java	2015-05-18 20:04:14.000000000 +0200
++++ hk2-hk2-parent-2.4.0-b24/hk2-configuration/persistence/hk2-xml-dom/config-generator/src/main/java/org/jvnet/hk2/config/generator/maven/AbstractConfigGeneratorMojo.java.config-generator	2015-05-26 21:56:49.828270082 +0200
+@@ -108,9 +108,18 @@
+             return;
+         }
+         
+-        if(!getGeneratedDirectory().mkdirs()){
+-          throw new MojoExecutionException(
+-            "Unable to create directory "+getGeneratedDirectory().getAbsolutePath());
++        getLog().info(getGeneratedDirectory().getAbsolutePath());
++        if (!getGeneratedDirectory().exists()) {
++            if (!getGeneratedDirectory().mkdirs()) {
++                getLog().info("Could not create output directory " +
++                        getOutputDirectory().getAbsolutePath());
++                return;
++            }
++        }
++        if (!getGeneratedDirectory().exists()) {
++            getLog().info("Exiting hk2-config-generator because could not find generated directory " +
++                  getGeneratedDirectory().getAbsolutePath());
++            return;
+         }
+         String outputPath = getGeneratedDirectory().getAbsolutePath();
+ 
diff --git a/glassfish-hk2.spec b/glassfish-hk2.spec
index 3bc684d..4be1be2 100644
--- a/glassfish-hk2.spec
+++ b/glassfish-hk2.spec
@@ -1,16 +1,9 @@
 %global namedreltag -b24
 %global namedversion %{version}%{?namedreltag}
-# build problems
-# [INFO] >>> maven-javadoc-plugin:2.10.3:aggregate (default-cli) > generate-sources @ hk2-parent >>>
-# [ERROR] Failed to execute goal org.glassfish.hk2:config-generator:2.4.0-b24:generate-injectors (default)
-# on project config-types: Unable to create directory
-# ...../hk2-configuration/persistence/hk2-xml-dom/config-types/target/generated-sources/hk2-config-generator/src/main/java
-# already exist
-%bcond_with javadoc
 
 Name:          glassfish-hk2
 Version:       2.4.0
-Release:       0.3.b24%{?dist}
+Release:       0.4.b24%{?dist}
 Summary:       Hundred Kilobytes Kernel
 License:       CDDL or GPLv2 with exceptions
 URL:           http://hk2.java.net/
@@ -28,6 +21,8 @@ Patch0:        glassfish-hk2-2.3.0-hk2-utils-osgi_bundle.patch
 Patch1:        glassfish-hk2-2.4.0-b24-disable-asm-all-repackaged.patch
 Patch2:        glassfish-hk2-2.3.0-disable-external-aopalliance.patch
 
+Patch3:        glassfish-hk2-2.4.0-b24-AbstractConfigGeneratorMojo.patch
+
 BuildRequires: maven-local
 BuildRequires: mvn(aopalliance:aopalliance)
 BuildRequires: mvn(args4j:args4j)
@@ -49,6 +44,7 @@ BuildRequires: mvn(org.apache.maven:maven-compat)
 BuildRequires: mvn(org.apache.maven:maven-core)
 BuildRequires: mvn(org.apache.maven:maven-plugin-api)
 BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
+BuildRequires: mvn(org.apache.maven.plugins:maven-clean-plugin)
 BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin)
 BuildRequires: mvn(org.apache.maven.shared:maven-osgi)
 BuildRequires: mvn(org.easymock:easymock)
@@ -226,13 +222,11 @@ Summary:       HK2 Implementation Utilities
 %description utils
 Hundred Kilobytes Kernel Implementation Utilities.
 
-%if %{with javadoc}
 %package javadoc
 Summary:       Javadoc for %{name}
 
 %description javadoc
 This package contains javadoc for %{name}.
-%endif
 
 %prep
 %setup -q -n hk2-hk2-parent-%{namedversion}
@@ -243,11 +237,10 @@ find . -name '*.class' -print -delete
 %patch0 -p0
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
-%if %{without javadoc}
-%pom_remove_plugin :maven-resources-plugin
-%endif
 
+%pom_remove_plugin :maven-resources-plugin
 %pom_remove_dep org.glassfish.hk2.external:aopalliance-repackaged hk2-extras
 %pom_add_dep aopalliance:aopalliance:'${aopalliance.version}' hk2-extras
 
@@ -281,6 +274,7 @@ find . -name '*.class' -print -delete
 %pom_xpath_remove "pom:plugin[pom:artifactId ='maven-surefire-plugin']/pom:configuration" hk2-locator
 
 %pom_xpath_set "pom:dependency[pom:groupId ='org.osgi']/pom:artifactId" org.osgi.core hk2-maven
+
 %pom_remove_dep org.apache.maven:maven-project hk2-maven
 %pom_add_dep org.apache.maven:maven-core hk2-maven
 %pom_add_dep org.apache.maven:maven-compat hk2-maven
@@ -407,11 +401,7 @@ sed -i 's/\r//' LICENSE.txt
 
 %build
 
-%if %{without javadoc}
-opts="-j"
-%endif
-# some tests fails for various cause
-%mvn_build $opts -- -Dmaven.test.failure.ignore=true
+%mvn_build -- -Dmaven.test.failure.ignore=true
 
 %install
 %mvn_install
@@ -502,12 +492,13 @@ opts="-j"
 %files utils -f .mfiles-utils
 %license LICENSE.txt
 
-%if %{with javadoc}
 %files javadoc -f .mfiles-javadoc
 %license LICENSE.txt
-%endif
 
 %changelog
+* Mon May 25 2015 gil cattaneo <puntogil at libero.it> 2.4.0-0.4.b24
+- fix failure on directory creation
+
 * Mon May 25 2015 gil cattaneo <puntogil at libero.it> 2.4.0-0.3.b24
 - enable javadoc sub package
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/glassfish-hk2.git/commit/?h=master&id=4945b19502ce66a08f534a09fa9ce5bd16be28df


More information about the scm-commits mailing list