Building multiple, interdependent plugins from a single maven build fails during test setup

24 views
Skip to first unread message

thomas.w...@de.amadeus.com

unread,
Jun 12, 2018, 4:18:44 AM6/12/18
to Jenkins Developers
Hi all,

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 reproduction repo can be found here: https://github.com/t-8ch/jenkins-multi-plugin-build-report.

Thanks!
Thomas

Stephen Connolly

unread,
Jun 12, 2018, 4:49:40 AM6/12/18
to jenkin...@googlegroups.com
On Tue 12 Jun 2018 at 09:18, <thomas.w...@de.amadeus.com> wrote:
Hi all,

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)



The reproduction repo can be found here: https://github.com/t-8ch/jenkins-multi-plugin-build-report.

Thanks!
Thomas

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/a6ae5236-65ce-437b-9fb6-86bd7f2ba934%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

Jesse Glick

unread,
Jun 12, 2018, 3:25:23 PM6/12/18
to Jenkins Dev
On Tue, Jun 12, 2018 at 4:49 AM, Stephen Connolly
<stephen.al...@gmail.com> wrote:
> 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

Sounds good to me. If nothing else, it would avoid the need to deploy
two copies of the same code when publishing.

> I have been unable to gain traction

Because of objections, or lack of time?

thomas.w...@de.amadeus.com

unread,
Jun 15, 2018, 2:17:07 AM6/15/18
to Jenkins Developers


On Tuesday, June 12, 2018 at 10:49:40 AM UTC+2, Stephen Connolly wrote:
On Tue 12 Jun 2018 at 09:18, <thomas.w...@de.amadeus.com> wrote:
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)

Thanks for the explanation!
I will stick to my current setup then.
 
Reply all
Reply to author
Forward
0 new messages