Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.0.5
-
Fix Version/s: None
-
Component/s: Artifacts and Repositories
-
Labels:None
-
Environment:Linux 2.6.18-gentoo-r6 #2 SMP PREEMPT Wed Feb 28 10:25:50 CET 2007 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
-
Complexity:Intermediate
-
Number of attachments :9
Description
Considering a multi-module project A which declares two sub-projects (modules) B and C. Having module C indicating in its POM a dependency against module B. Compilation and packaging work great without having to install module B in maven local repository, it locate module B for module C using declared aggregation at top level project A.
But for site goals it does not work, that is to say when maven try to generate site for module C it tells that module B artifact cannot be found. So we have to install module B to be able to generate module C site, whereas it is not necessary for compile or package goals.
I think it would be great if site goals behaves like compile and package with aggregation. It would be more coherent, and avoid to have to run install just for site goals.
-
- build.log
- 29/Apr/09 5:30 PM
- 12 kB
- John Casey
-
Hide
- gwttk-m2.zip
- 07/May/07 10:29 PM
- 19 kB
- Mat Gessel
-
- gwttk-m2/.classpath 0.3 kB
- gwttk-m2/.project 0.5 kB
- gwttk-m2/core/pom.xml 0.7 kB
- gwttk-m2/core/src/.../tk/client/App.java 0.2 kB
- gwttk-m2/core/src/.../tk/client/AppTest.java 0.7 kB
- gwttk-m2/debugstub/pom.xml 0.7 kB
- gwttk-m2/debugstub/src/.../client/App.java 0.3 kB
- gwttk-m2/debugstub/.../client/AppTest.java 0.7 kB
- gwttk-m2/demo/pom.xml 0.9 kB
- gwttk-m2/package.txt 6 kB
- gwttk-m2/pom.xml 3 kB
- gwttk-m2/sandbox/pom.xml 0.8 kB
- gwttk-m2/sandbox/src/.../sb/client/App.java 0.2 kB
- gwttk-m2/sandbox/src/.../client/AppTest.java 0.7 kB
- gwttk-m2/server/pom.xml 0.6 kB
- gwttk-m2/server/src/.../tk/server/App.java 0.2 kB
- gwttk-m2/server/src/.../server/AppTest.java 0.7 kB
- gwttk-m2/site.txt 8 kB
-
- maven.diff
- 08/Jun/09 8:36 AM
- 1 kB
- Tiago Bruno Pires Gomes
-
- maven.diff
- 29/May/09 11:00 AM
- 0.5 kB
- Tiago Bruno Pires Gomes
-
Hide
- maven-core-2.0.11-SNAPSHOT.jar
- 08/Jun/09 8:36 AM
- 160 kB
- Tiago Bruno Pires Gomes
-
- META-INF/MANIFEST.MF 0.4 kB
- org/apache/.../DefaultExtensionManager.class 11 kB
- org/.../DefaultExtensionManager$ProjectArtifactExceptionFilter.class 1 kB
- org/apache/.../ExtensionManager.class 0.5 kB
- org/apache/.../execution/BuildFailure.class 0.8 kB
- org/.../DefaultMavenExecutionRequest.class 4 kB
- org/apache/.../RuntimeInformation.class 0.2 kB
- org/.../DefaultRuntimeInformation.class 2 kB
- org/apache/.../MavenExecutionRequest.class 1 kB
- org/apache/.../execution/BuildSuccess.class 0.7 kB
- org/apache/.../execution/MavenSession.class 4 kB
- org/apache/.../ReactorManager.class 5 kB
- org/apache/.../BuildFailureException.class 0.5 kB
- org/apache/.../plugin/PluginManager$1.class 0.8 kB
- org/apache/.../plugin/PluginManager.class 3 kB
- org/.../DebugConfigurationListener.class 2 kB
- org/apache/.../PluginNotFoundException.class 1 kB
- org/.../DefaultPluginMappingManager.class 5 kB
- org/apache/.../PluginManagerException.class 0.6 kB
- org/apache/.../plugin/MojoExecution.class 2 kB
- org/.../PluginParameterException.class 4 kB
- org/apache/.../MavenPluginDiscoverer.class 1 kB
- org/apache/.../DefaultPluginManager.class 41 kB
- org/apache/.../version/IntervalUtils.class 3 kB
- org/.../PluginVersionNotFoundException.class 1.0 kB
- org/.../PluginVersionResolutionException.class 1 kB
- org/.../DefaultPluginVersionManager.class 18 kB
- org/apache/.../PluginVersionManager.class 1 kB
- org/apache/.../PluginVersionManager$1.class 0.8 kB
- org/.../PluginConfigurationException.class 8 kB
-
- mng-2979-testcase.tar.gz
- 30/Apr/09 7:54 AM
- 2 kB
- Oran Kelly
-
- package.txt
- 07/May/07 10:29 PM
- 6 kB
- Mat Gessel
-
- site.txt
- 07/May/07 10:29 PM
- 8 kB
- Mat Gessel
-
- to-package.log
- 29/Apr/09 5:33 PM
- 10 kB
- John Casey
Activity
gwttk-m2.zip
a skeleton project demonstrating the issue (site goal fails on "sandbox" module)
package.txt
the successful result of running "mvn package" in the root module directory
site.txt
the failed result of running "mvn site" in the root module directory
I believe this is not a missing feature, but a bug. If in the chain of called goals is some with "@requiresDependencyResolution compile" then it works (e.g. compilation during compile phase in default lifecycle) otherwise it does not - can be tested by calling "mvn compile site".
I checked it with Maven 2.0.8 and it still does not work: "mvn site" fails, but "mvn compile site" runs OK.
This is still an issue with Maven 2.0.9 and is causing trouble for us.
We also have a multi-module project of the form:
workspace/parent-module
workspace/module1
workspace/module2
...
If we start with a local repository that has none of these modules deployed and utter "mvn clean install site" in the parent-module, the build fails because it cannot resolve module1 as a dependency.
I have checked with the recently released 2.0.10 and 2.1.0 and the problem still exists in both.
I opened the gwttk-m2.zip file, cd'ed into the root directory, and executed the following:
mvn clean install site
using Maven 2.1.0 and JDK 1.4 on OS X 10.5, and had no problems. The attached build.log file reflects this. Note that I had made sure that all of net/asquare/** was removed from the local repository before doing so.
As for the approach of simply calling `mvn site` from the root without building at least to the package phase at the same time, where is the jar file for the dependency supposed to come from if nothing is producing it? I'm re-checking this process using `mvn clean package site` now, and will report my results.
this is the result of removing all net/asquare/** from the local repository, verifying that `mvn site` by itself fails, then running:
mvn clean package site
As you can see, everything is functioning well here. I'm going to close this issue. If you can provide a failing test case that uses Maven 2.1.0, please reopen.
This was probably fixed as part of the 2.1.0 release, but I'm leaving Fix-For at 2.2.0, since this is where I verified the problem as fixed.
John, it looks like you didn't verify the problem properly. Running "mvn install site" is the workaround.
The actual issue is that running "mvn site" in a multi-module project fails because Maven does not resolve dependencies properly.
I have attached a test case that I have confirmed fails with Maven-2.1.0 (and 2.0.10)
$ cd mng-2979/
$ cd ..
$ cd mng-2979/parent
$ rm -fr $HOME/.m2/repository/com/test
$ mvn clean install site
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Test Parent
[INFO] Module 1
[INFO] Module 2
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Parent
[INFO] task-segment: [clean, install, site]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /tmp/mng-2979/parent/target/pom-transformed.xml to /home/test/.m2/repository/com/test/parent/1.0/parent-1.0.pom
[INFO] Preparing surefire-report:report
[INFO] No goals needed for project - skipping
[INFO] Preparing surefire-report:report-only
[INFO] No goals needed for project - skipping
[INFO] Preparing javadoc:javadoc
[INFO] No goals needed for project - skipping
[INFO] Preparing javadoc:test-aggregate
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Parent
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building Module 1
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to /tmp/mng-2979/module1/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Building Module 2
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
Downloading: http://repo1.maven.org/maven2/com/test/module1/1.0/module1-1.0.jar
[INFO] Unable to find resource 'com.test:module1:jar:1.0' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.test:module1:jar:1.0
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.test -DartifactId=module1 -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.test -DartifactId=module1 -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.test:module2:jar:1.0
2) com.test:module1:jar:1.0
----------
1 required artifact is missing.
for artifact:
com.test:module2:jar:1.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Thu Apr 30 13:49:42 IST 2009
[INFO] Final Memory: 47M/412M
[INFO] ------------------------------------------------------------------------
I worked on this, these last two days, and I have attached a diff file. It's pretty ugly but works fine.
Diff file correcting probably the problem (but very ugly)
I tried to improve my last bugfix. So the only solution I've found is to do the maven goals successively. In other terms, mvn clean install site does :
TestParent clean
Module1 clean
Module2 clean
TestParent install
Module1 install
Module2 install
TestParent site ...
This issue is marked fixed for version 2.2.0 but if I try to execute the attached test case (mng-2979-testcase.tar.gz) using Maven 2.2.0, I still get the same broken behaviour as before. What exactly was fixed for 2.2.0? Was it something other than what I demonstrated in the given test case and if so, should I open a separate Jira issue for it?
I just wanted to add that I'm seeing the same behaviour under Maven 2.2.0. Like Oran said, it does not appear to be fixed. Maybe this ticket should be reopened?
Reopening based on the feedback of two users who apparently verified it isn't fixed. John, just close this again if confirmations turn out to be false.
Hi,
I got the problem with maven 2.0.9
mvn site or mvn clean install site doesn't work.
mvn clean install is working and of course after that mvn site works (using local repository)
is there a workaround with a single command line build ?
Do we have any workaround for this problem please?
As Barry mentioned above we need a way to do this in single line as thats what we need to provide in Hudson config.
Please leave us some comments.
Shrini
A work-around is to configure two separate jobs in Hudson: one for building (clean install), the other for generating and deploying the site ("site site:deploy" or directly "site-deploy").
We do it in our project: the normal build job is based on checking Subversion, the site build is time-based.
this is resolved in 3.0-alpha-5. mvn clean package site or mvn clean install site both work. mvn clean site works up until the point that the site report requires the module A dependency which was never built.
I'm running into this issue in 2.0.6 as well.
I'm going to attach several files:
gwttk-m2.zip: a skeleton project demonstrating the issue (site goal fails on "sandbox" module)
package.txt: the successful result of running "mvn package" in the root module directory
site.txt: the failed result of running "mvn site" in the root module directory
(Note: I also noticed that you cannot compile/package the child module independently unless its dependencies are checked into the repository )
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) net.asquare:gwttk:jar:0.2.3-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.asquare -DartifactId=gwttk \
-Dversion=0.2.3-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Path to dependency:
1) net.asquare:gwttk-sandbox:jar:0.2.3-SNAPSHOT
2) net.asquare:gwttk:jar:0.2.3-SNAPSHOT
----------
1 required artifact is missing.
for artifact:
net.asquare:gwttk-sandbox:jar:0.2.3-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:305)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:272)
at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1238)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:397)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more