Author: tchemit Date: 2010-11-11 22:09:37 +0100 (Thu, 11 Nov 2010) New Revision: 1872 Url: http://nuiton.org/repositories/revision/maven-license-plugin/1872 Log: Anomalie #812: Build fail on add-third-party goal when the pom of a dependency is not found Added: trunk/src/it/ano-812/ trunk/src/it/ano-812/README.txt trunk/src/it/ano-812/invoker.properties trunk/src/it/ano-812/pom.xml trunk/src/it/ano-812/verify.groovy Modified: trunk/pom.xml trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-11-11 21:08:53 UTC (rev 1871) +++ trunk/pom.xml 2010-11-11 21:09:37 UTC (rev 1872) @@ -316,7 +316,8 @@ <organization>CodeLutin</organization> <timezone>+2</timezone> <roles> - <role>Développeur</role> + <role>lead</role> + <role>developer</role> </roles> </developer> <developer> @@ -326,7 +327,7 @@ <organization>CodeLutin</organization> <timezone>+2</timezone> <roles> - <role>Développeur</role> + <role>developer</role> </roles> </developer> <developer> @@ -361,10 +362,10 @@ <properties> <!-- processor version --> - <processorVersion>1.0.4-SNAPSHOT</processorVersion> + <processorVersion>1.0.4</processorVersion> <!-- helper version --> - <helperPluginVersion>1.3-SNAPSHOT</helperPluginVersion> + <helperPluginVersion>1.2.9</helperPluginVersion> <!-- license project descriptor model version --> <mdoVersion>1.0.0</mdoVersion> @@ -375,6 +376,8 @@ <!-- documentation is in english then french --> <locales>en,fr</locales> + <mavenVersion>2.2.1</mavenVersion> + </properties> <build> @@ -480,21 +483,22 @@ <artifactId>maven-invoker-plugin</artifactId> <configuration> <pomIncludes> - <pomInclude>ano-816/pom.xml</pomInclude> - <pomInclude>ano-947/pom.xml</pomInclude> - <pomInclude>evol-952/pom.xml</pomInclude> - <pomInclude>evol-818/excluded-included/pom.xml</pomInclude> - <pomInclude>evol-818/multimodule-filters/pom.xml</pomInclude> - <pomInclude>evol-884/update-project-license/pom.xml</pomInclude> - <pomInclude>evol-884/update-file-header/pom.xml</pomInclude> - <pomInclude>evol-884/update-file-header-specific/pom.xml</pomInclude> - <pomInclude>add-third-party/no-encoding/pom.xml</pomInclude> - <pomInclude>aggregate-add-third-party/pom.xml</pomInclude> - <pomInclude>add-third-party/merge-licenses/pom.xml</pomInclude> - <pomInclude>add-third-party/no-deps/pom.xml</pomInclude> - <pomInclude>add-third-party/with-deps/pom.xml</pomInclude> - <pomInclude>update-file-header/pom.xml</pomInclude> - <pomInclude>update-project-license/pom.xml</pomInclude> + <pomInclude>ano-812/pom.xml</pomInclude> + <!--<pomInclude>ano-816/pom.xml</pomInclude>--> + <!--<pomInclude>ano-947/pom.xml</pomInclude>--> + <!--<pomInclude>evol-952/pom.xml</pomInclude>--> + <!--<pomInclude>evol-818/excluded-included/pom.xml</pomInclude>--> + <!--<pomInclude>evol-818/multimodule-filters/pom.xml</pomInclude>--> + <!--<pomInclude>evol-884/update-project-license/pom.xml</pomInclude>--> + <!--<pomInclude>evol-884/update-file-header/pom.xml</pomInclude>--> + <!--<pomInclude>evol-884/update-file-header-specific/pom.xml</pomInclude>--> + <!--<pomInclude>add-third-party/no-encoding/pom.xml</pomInclude>--> + <!--<pomInclude>aggregate-add-third-party/pom.xml</pomInclude>--> + <!--<pomInclude>add-third-party/merge-licenses/pom.xml</pomInclude>--> + <!--<pomInclude>add-third-party/no-deps/pom.xml</pomInclude>--> + <!--<pomInclude>add-third-party/with-deps/pom.xml</pomInclude>--> + <!--<pomInclude>update-file-header/pom.xml</pomInclude>--> + <!--<pomInclude>update-project-license/pom.xml</pomInclude>--> </pomIncludes> <postBuildHookScript>verify</postBuildHookScript> <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath> Added: trunk/src/it/ano-812/README.txt =================================================================== --- trunk/src/it/ano-812/README.txt (rev 0) +++ trunk/src/it/ano-812/README.txt 2010-11-11 21:09:37 UTC (rev 1872) @@ -0,0 +1,7 @@ +To test when a dependency has no pom file in repository. In that case, we must +act this dependency as a unknown license. + +We are using a known dependency in central to be without pom, says +woodstox:wstx-asl:3.2.7 + +See http://nuiton.org/issues/show/812 \ No newline at end of file Added: trunk/src/it/ano-812/invoker.properties =================================================================== --- trunk/src/it/ano-812/invoker.properties (rev 0) +++ trunk/src/it/ano-812/invoker.properties 2010-11-11 21:09:37 UTC (rev 1872) @@ -0,0 +1,22 @@ + +# A comma or space separated list of goals/phases to execute, may +# specify an empty list to execute the default goal of the IT project +invoker.goals=license:add-third-party + +# Optionally, a list of goals to run during further invocations of Maven +#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run + +# A comma or space separated list of profiles to activate +#invoker.profiles=run-all run-once + +# The value for the environment variable MAVEN_OPTS +#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m + +# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never" +invoker.failureBehavior=fail-fast + +# The expected result of the build, possible values are "success" (default) and "failure" +#invoker.buildResult=success + +# A boolean value controlling the -N flag, defaults to "false" +#invoker.nonRecursive=false Added: trunk/src/it/ano-812/pom.xml =================================================================== --- trunk/src/it/ano-812/pom.xml (rev 0) +++ trunk/src/it/ano-812/pom.xml 2010-11-11 21:09:37 UTC (rev 1872) @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <groupId>org.nuiton.license.test</groupId> + <artifactId>test-ano-812</artifactId> + <version>@pom.version@</version> + + <name>License Test :: ano-812</name> + + <inceptionYear>2012</inceptionYear> + + <dependencies> + <dependency> + <groupId>woodstox</groupId> + <artifactId>wstx-asl</artifactId> + <version>3.2.7</version> + </dependency> + </dependencies> + + <organization> + <name>License Test</name> + </organization> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <license.verbose>true</license.verbose> + <license.licenseName>lgpl_v3</license.licenseName> + </properties> + <build> + + <pluginManagement> + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>@pom.version@</version> + </plugin> + </plugins> + </pluginManagement> + </build> + +</project> + + Added: trunk/src/it/ano-812/verify.groovy =================================================================== --- trunk/src/it/ano-812/verify.groovy (rev 0) +++ trunk/src/it/ano-812/verify.groovy 2010-11-11 21:09:37 UTC (rev 1872) @@ -0,0 +1,8 @@ + +file = new File(basedir, 'target/generated-sources/license/THIRD-PARTY.txt'); +assert file.exists(); +content = file.text; +assert !content.contains( 'the project has no dependencies.' ); +assert content.contains( '(Unknown license) wstx-asl (woodstox:wstx-asl:3.2.7 - no url defined)' ); + +return true; Modified: trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java 2010-11-11 21:08:53 UTC (rev 1871) +++ trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java 2010-11-11 21:09:37 UTC (rev 1872) @@ -264,7 +264,7 @@ artifact, remoteRepositories, localRepository, - false + true ); if (isVerbose()) { log.info("add dependency [" + id + "]");