Project structure is:
/foo
pom.xml
/foo-war
pom.xml
/foo-ear
pom.xml
This is my parent pom.xml
:
..
<modules>
<module>foo-war</module>
<module>foo-ear</module>
</modules>
..
This is the content of foo-ear/pom.xml
:
..
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>foo-war</artifactId>
<type>war</type>
<version>${project.version}</version>
</dependency>
</dependencies>
..
Compilation fails with this message:
...
[INFO] Failed to resolve artifact.
Missing:
—————
1) com.foo:foo-war:war:1.0-SNAPSHOT
Try downloading the file manually from the project website.
...
Looks like foo-ear
is trying to resolve the artifact when it's not ready yet. How can I instruct maven to work with foo-war
beforehand? Or I'm missing something?
ps. Everything is fixed when I remove this code from parent pom.xml
:
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.version}</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</build>
Why?