I want to divide my continuous integration work (Hudson) into two phases. (Because the lead time with assembly and reporting takes too much time.) In the first task, I successfully create a multi module maven project with the "mvn package". Then I copy my workspace to another place and again try to build the project only with the goal of "site" and / or findbugs / checkstyle / pmd to create reports. But that will not work! Maven cannot resolve the dependency of my submodules. (But all JARs are available in destination folders.)
Example: My structure looks like this:
Project C has dependency project B.
When I create everything using the "mvn site", it generates for all projects A and B. But I stopped in project C with the error message "Could not resolve dependencies for project B." But project B is already built with the "mvn" package. That is, I can find the project B JAR file in my target folder.
Is there any way to resolve dependency on submodule B without installing "mvn install"? (I do not want to do this on my ci server. I am afraid that this could be dangerous for other jobs with the same code base.)
Update 08/20/12:
POM root folder:
<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> <name>Foo</name> <groupId>foo</groupId> <artifactId>bar</artifactId> <version>1.0</version> <packaging>pom</packaging> <modules> <module>parent</module> </modules> </project>
Parent POM:
<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> <name>Foo</name> <groupId>foo</groupId> <artifactId>parent</artifactId> <version>1.0</version> <packaging>pom</packaging> <modules> <module>../bar-a</module> <module>../bar-b</module> <module>../bar-c</module> <module>../bar-d</module> </modules> [...] <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.5.1</version> [...] </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>2.7.1</version> [...] </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.9.1</version> [...] </plugin> </plugins> </reporting> </project>
POM of B:
<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> <parent> <groupId>foo</groupId> <artifactId>parent</artifactId> <version>1.0</version> <relativePath>../parent</relativePath> </parent> <name>Bar B</name> <artifactId>bar-b</artifactId> <version>1.0</version> <packaging>jar</packaging> [...] </project>
POM of C:
<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> <parent> <groupId>foo</groupId> <artifactId>parent</artifactId> <version>1.0</version> <relativePath>../parent</relativePath> </parent> <name>Bar C</name> <artifactId>bar-c</artifactId> <packaging>jar</packaging> [...] <dependencies> <dependency> <groupId>foo</groupId> <artifactId>bar-b</artifactId> <version>1.0</version> </dependency> </dependencies> [...] </project>
source share