maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimitri BAELI (JIRA)" <>
Subject [jira] (MNG-4996) Maven3 parallel build fails occasionally for classpath problems.
Date Sun, 16 Jun 2013 12:36:05 GMT


Dimitri BAELI commented on MNG-4996:

I have similar issue when assembly and compilation are concurrent.

The compiler plugin classpath is empty (only classes/ dir), when it tries to compile.

I succedded to provide a way to reproduce it, by taking a sub-part of our build.
* The source code is here :
* The build with success (without -T2) and with the failure (using -T2) are available here


It still occur with maven 3.1-SNAPSHOT, and I tried to debug it with maven source code, but
failed to find the exact reason of the failure.

* CompilerMojo.classpathElements are wrong when the config/pom.xml is processed.

My searches comparing single threaded and multi-threaded execution show a hot spot on this
code from the MojoExecutor:
    public void execute( MavenSession session, MojoExecution mojoExecution, ProjectIndex projectIndex,
                         DependencyContext dependencyContext, PhaseRecorder phaseRecorder
        throws LifecycleExecutionException
        execute( session, mojoExecution, projectIndex, dependencyContext );
        phaseRecorder.observeExecution( mojoExecution );

The phaseRecorder.observeExecution( mojoExecution ) is the one who provides the right classpath
to the compiler on the single threaded execution.
And the MojoExecutor.ensureDependenciesAreResolved fails to replace that in a multi-threaded

I'll continue to investigate, but if all that speaks to you I'll be glad to simply have a

> Maven3 parallel build fails occasionally for classpath problems.
> ----------------------------------------------------------------
>                 Key: MNG-4996
>                 URL:
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 3.0.1
>         Environment: maven 3.0.1, maven 3.0
>            Reporter: Kari J. Niemi
>            Assignee: Kristian Rosenvold
> In a multimodule (>120 modules) maven build, the compiler plug-in would seem to fail
in creating a correct class-path every now and then.
> Instead of this entry in maven -X logs for a single module build:
> ----
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile'
with basic configurator -->
> ..
> [DEBUG]   (f) classpathElements = [/home/karniemi/"mymodulepath"/target/classes, /home/karniemi/.m2/repository/org/apache/servicemix/servicemix-utils/1.2.0/servicemix-utils-1.2.0.jar,
/home/karniemi/.m2/repository/org/codehaus/woodstox/wstx-asl/3.2.6/wstx-asl-3.2.6.jar, /home/karniemi/.m2/repository/org/apache/servicemix/specs/org.apache.servicemix.specs.jbi-api-1.0/1.4.0/org.apache.servicemix.specs.jbi-api-1.0-1.4.0.jar,
> ----
> every now and then I get this in the parallel build:
> ----
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile'
with basic configurator -->
> ...
> [DEBUG]   (f) classpathElements = [/home/karniemi/"mymodulepath"/target/classes]
> ----
> And of course the compilation fails because none of the dependencies are added to the
classpath. Sometimes it goes fine in the multi-module build, but every now and then it fails
for this.
> In both maven runs I can see that the dependencies are resolved fine:
> ----------
> [DEBUG] "mymodule":jar:DYNAMIC-SNAPSHOT
> [DEBUG]    junit:junit:jar:4.7:test
> [DEBUG]    org.apache.servicemix:servicemix-utils:jar:1.2.0:provided
> [DEBUG]       org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:provided
> [DEBUG]       org.codehaus.woodstox:wstx-asl:jar:3.2.6:provided
> [DEBUG]       org.apache.servicemix.specs:org.apache.servicemix.specs.jbi-api-1.0:jar:1.4.0:provided
(scope managed from compile) (version managed from 1.1.0)
> [DEBUG]          org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.2:provided
> [DEBUG]    log4j:log4j:jar:1.2.14:provided
> -----------
> The  pluginArtifactMap looks like this:
> --------------------
> [DEBUG]   (s) pluginArtifactMap = {org.apache.maven.plugins:maven-surefire-plugin=org.apache.maven.plugins:maven-surefire-plugin:maven-plugin:2.6:,
org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:2.0.5:compile, junit:junit=junit:junit:jar:3.8.1:compile,
> --------------------
> I'm really using jbi-maven-plugin for most of the modules, and that plugin binds the
other plugins -also the compiler-plugin -to maven life-cycle phases.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message