You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the flatten plugin to resolve the ${revision} variable prior to artifact deployment for downstream consumption, as mandated by Maven's CI-Friendly practices. However, the systemPath dependency isn't resolved properly. The environment variable is set correctly, and the build works perfectly when not using the flatten plugin - albeit the artifacts produced aren't consumable from a repository due to the use of <version>${revision}</version> to allow easy manipulation of the project's version.
This is the exception dump I get from using mvn -e:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.3.0:flatten (flatten.process-resources) on project my-artifact-name: 1 problem was encountered while building the effective model for my.group.id:my-artifact-name:1.0.0
[ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for dependency.group.id:dependency-artifact:jar must specify an absolute path but is ${env.TOOL_INSTALL_PATH}/lib/main-tool.jar @
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: 1 problem was encountered while building the effective model for my.group.id:my-artifact-name:1.0.0
[ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for dependency.group.id:dependency-artifact:jar must specify an absolute path but is ${env.TOOL_INSTALL_PATH}/lib/main-tool.jar @
at org.codehaus.mojo.flatten.FlattenMojo.createEffectivePom (FlattenMojo.java:986)
at org.codehaus.mojo.flatten.FlattenMojo.createFlattenedPom (FlattenMojo.java:594)
at org.codehaus.mojo.flatten.FlattenMojo.execute (FlattenMojo.java:422)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective model for my.group.id:my-artifact-name:1.0.0
[ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for dependency.group.id:dependency-artifact:jar must specify an absolute path but is ${env.TOOL_INSTALL_PATH}/lib/main-tool.jar @
at org.apache.maven.model.building.DefaultModelProblemCollector.newModelBuildingException (DefaultModelProblemCollector.java:197)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:568)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:454)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:267)
at org.codehaus.mojo.flatten.ModelBuilderThreadSafetyWorkaround.build (ModelBuilderThreadSafetyWorkaround.java:134)
at org.codehaus.mojo.flatten.FlattenMojo.createEffectivePom (FlattenMojo.java:982)
at org.codehaus.mojo.flatten.FlattenMojo.createFlattenedPom (FlattenMojo.java:594)
at org.codehaus.mojo.flatten.FlattenMojo.execute (FlattenMojo.java:422)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Per other tickets I've found, and the integration test system-scope-dep-variable, variable expansion should work on systemPath dependencies. However, it seems that environment variable expansion isn't working properly.
Is there a workaround that I've not found? Is this a fixable bug?
I'm aware that systemPath dependencies are on their way out and we're trying to grapple with how to properly live in that world when it comes ... for now, however, it makes sense to use it for this specific project given that the dependency in question is a legacy library that isn't and will never be available via a Maven repository (long story, trust me on this).
Thoughts?
Cheers!
The text was updated successfully, but these errors were encountered:
Hi! I'm using something similar to this:
I'm trying to use the flatten plugin to resolve the ${revision} variable prior to artifact deployment for downstream consumption, as mandated by Maven's CI-Friendly practices. However, the systemPath dependency isn't resolved properly. The environment variable is set correctly, and the build works perfectly when not using the flatten plugin - albeit the artifacts produced aren't consumable from a repository due to the use of
<version>${revision}</version>
to allow easy manipulation of the project's version.This is the exception dump I get from using
mvn -e
:Per other tickets I've found, and the integration test system-scope-dep-variable, variable expansion should work on systemPath dependencies. However, it seems that environment variable expansion isn't working properly.
Is there a workaround that I've not found? Is this a fixable bug?
I'm aware that systemPath dependencies are on their way out and we're trying to grapple with how to properly live in that world when it comes ... for now, however, it makes sense to use it for this specific project given that the dependency in question is a legacy library that isn't and will never be available via a Maven repository (long story, trust me on this).
Thoughts?
Cheers!
The text was updated successfully, but these errors were encountered: