mvn site vs an unusual maven-dependency-plugin configuration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

mvn site vs an unusual maven-dependency-plugin configuration

Alex O'Ree
I've been struggling with this problem on and off for a while and have been
unable to resolve this. Hopefully someone can provide some guidance. This
is a multi-module project.

I have a jar project that needs some native libraries in a specific path
during the unit tests. To make this happen, I declare the dependency (it's
a zip file in central), then use the maven-dependency-plugin
(unpack-dependencies goal) to copy the dependencies to the target folder
using the phase "compile". I've tried other phases but this is the only one
that i tried whereby this works. Then 'copy-dependencies' goal, again with
the compile phase.

Next i call the maven-resources-plugin with the phase
"generate-test-resources" to shuffle some of the files around (from the
target/dependency folder to the target folder).

I also call maven-ant-plugin with the "compile" phase to unzip the zip file
and move some other files around.

All of this works correctly, unit tests fire off without an issue.

Enter maven site (currently running 3.6 but i can try other versions if
needed).
When running mvn site from the parent project directory, it always fails
(references MDEP-187) with this configuration. The specific message is:

Failed to get report for maven-javadoc-plugin: failed to execute goal
...maven-dependency-plugin:3.0.0:copy-dependencies on project...artifact
has not been packaged yet. When used on a reactor artifact, copy should be
executed after packaging. see MDEP-187

If I change the phases for copy-dependencies to the "prepare-package"
phase. While this resolves the maven site issue, this causes the regular
build with tests to fail. However this is only when building mvn site from
the parent pom. When running mvn site in the directory for this specific
module works fine.

I tried adding both the site and javadoc plugin to the module's pom with
skip=true, however this problem still comes up when running mvn site from
the parent module.

I'm out of ideas, can anyone help?