I am trying to build multiple Jenkins plugins from a single maven build. Each maven module contains one plugin.
The build seems to run fine but when running the `test` phase with multiple plugins in one reactor the following error occurs:
```
[ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:2.6:resolve-test-dependencies (default-resolve-test-dependencies) on project plugin: Failed to copy dependency plugins: Source '/tmp/jenkins-multi-plugin-build-report/config/target/classes' exists but is a directory -> [Help 1]
```
And indeed the path in the error message is a directory.
When I run only a single project in the reactor (with `mvn -pl ...`) the test works fine.
Am I doing something wrong or is this a bug in the maven-hpi-plugin?
The hpi plugin lifecycle is a hack and you have found some limitations of that hack.
The issue here is that the primary artifact is effectively a .war fragment, and instead of dependency being on the <type>hpi</type> it is on the <type>jar</type> (ie the default type)... which will not exist until after “package”
The hpi plugin does more hacks to make things work, but those rely on everything either being the previous build from the local repo cache or begin the current build progressed up to at least “package”.
Since at least March 2nd 2011 I have been campaigning that we should change the packaging from a war fragment to a jar with web resources in META-INF, that would mean that the plugin was classpath compatible and all the hacks would melt away... but I have been unable to gain traction (sad panda)