Project structure is:
/foo
pom.xml
/foo-war
pom.xml
/foo-ear
pom.xml
This is my parent pom.xml:
..
foo-war
foo-ear
..
This is the content of foo-ear/pom.xml:
..
${project.groupId}
foo-war
war
${project.version}
..
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?
The problem looks similar to
MJAVADOC-161and more generallyMJAVADOC-137. Could you be using a buggy version of themaven-javadoc-pluginlike 2.3 (sadly, you’re not showing it)? If yes, try with version 2.4 or another more recent version. And if you are using a version greater than 2.4, try with the version 2.4 to see if a regression was introduced at some point. And in this case, please open a new issue.I didn’t pay attention to the goal,
javadoc:aggregatehas been introduced in version 2.5 so it won’t be in 2.4 indeed and the issues mentioned above aren’t relevant.But I took a second look and I saw some others like MJAVADOC-275 or MJAVADOC-276. I’m not sure to understand the exact status (and the bug might be not fixed) but before opening an issue, be sure to try with versions 2.7 and version 2.6 (some people mention a regression introduced in 2.6.1).