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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

thomas.weissschuh
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

--
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

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

stephenconnolly


On Tue 12 Jun 2018 at 09:18, <[hidden email]> 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 [hidden email].
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMwSOiifYJ5o%2BQ%2BQ59Qpgw49amHdWEPV6E4Q-XVZzu7%3DsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Jesse Glick-4
On Tue, Jun 12, 2018 at 4:49 AM, Stephen Connolly
<[hidden email]> 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?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1TZjGrzBcu0MX3WmByFf4XY2rc5%3DRSUJ8cN%2B%3DeLmU3Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

thomas.weissschuh
In reply to this post by stephenconnolly


On Tuesday, June 12, 2018 at 10:49:40 AM UTC+2, Stephen Connolly wrote:
On Tue 12 Jun 2018 at 09:18, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="RL9JCYguBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">thomas.w...@....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.
 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b5517ca7-6354-43ce-9a7a-bf78dc881613%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.