Question

I have a little bit of strange Problem with Jenkins, Maven and Tycho and it is hard to find out who is the culprit.

All SCM Triggered Builds fail but all manually triggered builds succeed.

Jenkins Version : Jenkins ver. 1.527
Maven Version : 3.05

I have a modularized tycho build:

<modules>
    <module>../main.plugin.test</module>
    <module>../main.plugin.internationalization.at</module>
    <module>../crud.plugin</module>
    <module>../rest.plugin</module>
    <module>../main.plugin</module>
    <module>../main.feature</module>
    <module>../product</module>
    <module>../target-definition</module>
    <module>../rest.plugin.test</module>
</modules>

Jenkins is configured as a simple maven build with modules.

It just executes:

-X clean deploy

When an SCM-Build is triggered some modules are not build.

enter image description here

When I build it manually everything is fine:

enter image description here

This behaviour is consistent. I already tried

  • switching to a different Maven version (3.05 / 3.04)
  • deleting the whole workspace prior to building
  • clean checkout of all sources
  • running of -X deploy (without clean)

Any amount of manual invocations succeeds. And any amount of scm triggers fails.

Both Maven logs look exactly the same until (working):

[INFO] Reactor Build Order:
[INFO] 
[INFO] client-master
[INFO] crud-plugin
[INFO] main-plugin
[INFO] ------------.main.plugin.test
[INFO] ------------.main.plugin.internationalization.at
[INFO] rest-plugin
[INFO] main-plugin
[INFO] ------------.product
[INFO] target-definition
[INFO] ------------.rest.plugin.test

and (failing):

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] main-plugin
[INFO] ------------.plugin.test
[INFO] ------------.main.plugin.internationalization.at
[INFO] rest-plugin
[INFO] main-plugin
[INFO] ------------.product
[INFO] ------------.rest.plugin.test

The final error message therefore is:

Caused by: java.lang.IllegalStateException: ------------..client:------------..crud.plugin:eclipse-plugin:1.0.0-SNAPSHOT does not provide an artifact with classifier 'null'

Customer specific module names are replaced with ------------. in this question.

Was it helpful?

Solution

I have heard repeatedly of vague problems with Tycho builds on Jenkins. The reason for these problems seems to be that some Jenkins plugin triggering these builds hooks into the Maven lifecycle and this somehow collides with what Tycho does in the Maven internals.

For the problem that you are describing, it seems that the Jenkins plugin that you are using is changing the module build order. This may be okay for a normal Maven build (where all dependencies are declared in the POMs), but may fail for a Maven/Tycho build, where dependencies are computed by Tycho during the build.

To avoid this problem, you should trigger the Maven build in a way that is closer to a normal command line build. I found that the Invoke top-level Maven targets build step from the Maven Integration plugin works without problems.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top