question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parallel maven build warnings

See original GitHub issue

Description

I’ve got following warnings when trying to use docker-maven-plugin in parallel mode (mvn docker:build -T):

[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project      *
[WARNING] * contains the following plugin(s) that have goals not marked   *
[WARNING] * as @threadSafe to support parallel building.                  *
[WARNING] * While this /may/ work fine, please look for plugin updates    *
[WARNING] * and/or request plugins be made thread-safe.                   *
[WARNING] * If reporting an issue, report it against the plugin in        *
[WARNING] * question, not against maven-core                              *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadSafe in project:
[WARNING] io.fabric8:docker-maven-plugin:0.23.0
[WARNING] Enable debug to see more precisely which goals are not marked @threadSafe.
[WARNING] *****************************************************************

Info

  • d-m-p version : 0.23.0
  • Maven version (mvn -v) : 3.5.0

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:8
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
wborncommented, Dec 12, 2017

Even though there is a warning we’ve been using it to build containers without any problems in parallel builds for months now. 🙂

0reactions
mattnelsoncommented, Aug 30, 2019

@rhuss Here is a stack during a parallel build when it appears to be hung, locking on object 0x0000000782adfa28

Culprit in maven https://github.com/apache/maven/blob/maven-3.6.1/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java#L296

Based on the change log for 3.6.2 I believe this issue may be addressed. https://issues.apache.org/jira/issues/?jql=project %3D MNG AND fixVersion %3D 3.6.2

thread with the lock

"BuilderThread 1" #27 prio=5 os_prio=31 cpu=15490.35ms elapsed=90.94s tid=0x00007febea75c800 nid=0x730f runnable  [0x000070000f068000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.Class.isAssignableFrom(java.base@11.0.4/Native Method)
	at jdk.internal.reflect.UnsafeFieldAccessorImpl.ensureObj(java.base@11.0.4/UnsafeFieldAccessorImpl.java:57)
	at jdk.internal.reflect.UnsafeObjectFieldAccessorImpl.get(java.base@11.0.4/UnsafeObjectFieldAccessorImpl.java:36)
	at java.lang.reflect.Field.get(java.base@11.0.4/Field.java:418)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction$MapField.doInterpolate(StringSearchModelInterpolator.java:430)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction$CacheField.interpolate(StringSearchModelInterpolator.java:302)
	- locked <0x0000000782adfa28> (a java.lang.reflect.Field)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction$CacheItem.interpolate(StringSearchModelInterpolator.java:275)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.java:160)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.run(StringSearchModelInterpolator.java:134)
	at java.security.AccessController.doPrivileged(java.base@11.0.4/Native Method)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator.interpolateObject(StringSearchModelInterpolator.java:81)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator.interpolateModel(StringSearchModelInterpolator.java:64)
	at org.apache.maven.model.building.DefaultModelBuilder.interpolateModel(DefaultModelBuilder.java:781)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:388)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:171)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:340)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:297)
	at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:577)
	at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:190)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:551)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect(DefaultLegacyArtifactCollector.java:148)
	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:504)
	at org.apache.maven.repository.legacy.LegacyRepositorySystem.resolve(LegacyRepositorySystem.java:367)
	at org.apache.maven.plugins.assembly.artifact.DefaultDependencyResolver.resolveTransitively(DefaultDependencyResolver.java:233)
	at org.apache.maven.plugins.assembly.artifact.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:119)
	at org.apache.maven.plugins.assembly.artifact.DefaultDependencyResolver.resolveDependencySets(DefaultDependencyResolver.java:155)
	at org.apache.maven.plugins.assembly.archive.phase.DependencySetAssemblyPhase.execute(DependencySetAssemblyPhase.java:95)
	at org.apache.maven.plugins.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:181)
	at io.fabric8.maven.docker.assembly.DockerAssemblyManager.createAssemblyArchive(DockerAssemblyManager.java:466)
	at io.fabric8.maven.docker.assembly.DockerAssemblyManager.createDockerTarArchive(DockerAssemblyManager.java:115)
	at io.fabric8.maven.docker.service.ArchiveService.createArchive(ArchiveService.java:123)
	at io.fabric8.maven.docker.service.ArchiveService.createArchive(ArchiveService.java:118)
	at io.fabric8.maven.docker.service.BuildService.buildImage(BuildService.java:132)
	at io.fabric8.maven.docker.service.BuildService.buildImage(BuildService.java:70)
	at io.fabric8.maven.docker.BuildMojo.buildAndTag(BuildMojo.java:74)
	at io.fabric8.maven.docker.BuildMojo.processImageConfig(BuildMojo.java:105)
	at io.fabric8.maven.docker.BuildMojo.executeInternal(BuildMojo.java:61)
	at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:230)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:202)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:198)
	at java.util.concurrent.FutureTask.run(java.base@11.0.4/FutureTask.java:264)
	at java.util.concurrent.Executors$RunnableAdapter.call(java.base@11.0.4/Executors.java:515)
	at java.util.concurrent.FutureTask.run(java.base@11.0.4/FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.4/ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.4/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

thread waiting on the lock

"BuilderThread 23" #283 prio=5 os_prio=31 cpu=4023.80ms elapsed=83.59s tid=0x00007febf194d800 nid=0xc91f waiting for monitor entry  [0x000070000f779000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction$CacheField.interpolate(StringSearchModelInterpolator.java:296)
	- waiting to lock <0x0000000782adfa28> (a java.lang.reflect.Field)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction$CacheItem.interpolate(StringSearchModelInterpolator.java:275)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.java:160)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.run(StringSearchModelInterpolator.java:134)
	at java.security.AccessController.doPrivileged(java.base@11.0.4/Native Method)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator.interpolateObject(StringSearchModelInterpolator.java:81)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator.interpolateModel(StringSearchModelInterpolator.java:64)
	at org.apache.maven.model.building.DefaultModelBuilder.interpolateModel(DefaultModelBuilder.java:781)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:394)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:171)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:340)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:297)
	at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:577)
	at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:190)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:551)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:605)
	at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect(DefaultLegacyArtifactCollector.java:148)
	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:504)
	at org.apache.maven.repository.legacy.LegacyRepositorySystem.resolve(LegacyRepositorySystem.java:367)
	at org.apache.maven.plugins.assembly.artifact.DefaultDependencyResolver.resolveTransitively(DefaultDependencyResolver.java:233)
	at org.apache.maven.plugins.assembly.artifact.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:119)
	at org.apache.maven.plugins.assembly.artifact.DefaultDependencyResolver.resolveDependencySets(DefaultDependencyResolver.java:155)
	at org.apache.maven.plugins.assembly.archive.phase.DependencySetAssemblyPhase.execute(DependencySetAssemblyPhase.java:95)
	at org.apache.maven.plugins.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:181)
	at io.fabric8.maven.docker.assembly.DockerAssemblyManager.createAssemblyArchive(DockerAssemblyManager.java:466)
	at io.fabric8.maven.docker.assembly.DockerAssemblyManager.createDockerTarArchive(DockerAssemblyManager.java:115)
	at io.fabric8.maven.docker.service.ArchiveService.createArchive(ArchiveService.java:123)
	at io.fabric8.maven.docker.service.ArchiveService.createArchive(ArchiveService.java:118)
	at io.fabric8.maven.docker.service.BuildService.buildImage(BuildService.java:132)
	at io.fabric8.maven.docker.service.BuildService.buildImage(BuildService.java:70)
	at io.fabric8.maven.docker.BuildMojo.buildAndTag(BuildMojo.java:74)
	at io.fabric8.maven.docker.BuildMojo.processImageConfig(BuildMojo.java:105)
	at io.fabric8.maven.docker.BuildMojo.executeInternal(BuildMojo.java:61)
	at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:230)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:202)
	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:198)
	at java.util.concurrent.FutureTask.run(java.base@11.0.4/FutureTask.java:264)
	at java.util.concurrent.Executors$RunnableAdapter.call(java.base@11.0.4/Executors.java:515)
	at java.util.concurrent.FutureTask.run(java.base@11.0.4/FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.4/ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.4/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Thread-safe warning when executing maven parallel build
I am running Maven parallel build. I am gettting some warning. ... The build is success. Can some one tell me which version...
Read more >
Support parallel builds in maven : KT-10028
When I build the multimodule project in multiple threads with mvn clean install -T 2, I get the following notification for each module:...
Read more >
Maven Surefire Plugin – surefire:test - Apache Maven
The goal is thread-safe and supports parallel builds. Binds by default to the lifecycle phase: test . Optional Parameters. Name, Type, Since ...
Read more >
380169 – Support for maven parallel build - Bugs - Eclipse
When I try to run my build in parallel using the maven -T option (e.g. mvn -T 1C), I do get warning that...
Read more >
Improve the Performance of Gradle Builds
Parallel builds can significantly improve build times; how much depends on ... Warning: Gradle's Groovy DSL relies heavily on Groovy's dynamic features.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found