Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with "No repo reference" with a plugin dependency #9

Closed
victornoel opened this issue Jan 9, 2015 · 7 comments
Closed

Bug with "No repo reference" with a plugin dependency #9

victornoel opened this issue Jan 9, 2015 · 7 comments

Comments

@victornoel
Copy link

Hi,

I have a project in a multi-module set-up that is used only as a dependency to a plugin declared in the parent pom of other projects in this multi-module set-up (it's a project containing enforcer rules used by the other projects).
This module is deployed on a repository (ow2 snapshots) declared in my settings.xml.

When I try to run the check goal of duplicate-finder-maven-plugin I get the following error:

[ERROR] Failed to execute goal org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check (check-duplicates) on project petals-commons-log: Execution check-duplicates of goal org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check failed: Found project reference to org.ow2.petals:petals-enforcer-rules:jar:1.0.4-SNAPSHOT but no repo reference! -> [Help 1]

I don't think it is normal, and moreover I don't see why it should look for it in a repository since it is part of the reactor build!

Thanks!

@hgschmie
Copy link
Contributor

hgschmie commented Jan 9, 2015

Hi Victor,

sorry to hear about your problem. Can you give me a bit more information:

  • run the maven build with -X and put the output on a gist (can be a private gist if necessary, send me the link by mail (on my github profile)).
  • is petals-enforcer-rules the project you are trying to build? Or is that a dependency? I noticed that it is in SNAPSHOT, did you build that locally or did you download it (e.g. from oss snapshots)?
  • do you have additional repos in your pom?

@victornoel
Copy link
Author

Hi, I created a test project for it that exhibit the problem!
The only difference with my case is that the nothing is deployed to an online repository but that shouldn't be a problem to me normally since everything is available from the reactor build or in the local m2 repository.

It is here: https://wwwsecu.irit.fr/FILEX/get?k=53nVEl2KJYh57vj1bPl
The bug appears when calling mvn clean install in the root of the multi-modules project.
You can also directly install test-plugin-dep with mvn clean install and then try again at the root to do a mvn clean install.

In both case it fails with this error:

[INFO] --- duplicate-finder-maven-plugin:1.1.0:check (default) @ test-failing-project ---
[DEBUG] Configuring mojo org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check from plugin realm ClassRealm[plugin>org.basepom.maven:duplicate-finder-maven-plugin:1.1.0, parent: sun.misc.Launcher$AppClassLoader@626287d3]
[DEBUG] Configuring mojo 'org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check' with basic configurator -->
[DEBUG]   (f) checkCompileClasspath = true
[DEBUG]   (f) checkRuntimeClasspath = true
[DEBUG]   (f) checkTestClasspath = true
[DEBUG]   (f) conflictingDependencies = []
[DEBUG]   (f) failBuildInCaseOfConflict = false
[DEBUG]   (f) failBuildInCaseOfDifferentContentConflict = true
[DEBUG]   (f) failBuildInCaseOfEqualContentConflict = false
[DEBUG]   (s) ignoredDependencies = []
[DEBUG]   (f) preferLocal = true
[DEBUG]   (f) printEqualFiles = false
[DEBUG]   (f) quiet = false
[DEBUG]   (f) resultFile = /home/victor/code/test-rootbuilder/test-failing-project/target/duplicate-finder-result.xml
[DEBUG]   (f) resultFileMinClasspathCount = 2
[DEBUG]   (f) skip = false
[DEBUG]   (f) useDefaultResourceIgnoreList = true
[DEBUG]   (f) useResultFile = true
[DEBUG]   (f) project = MavenProject: test:test-failing-project:0.0.1-SNAPSHOT @ /home/victor/code/test-rootbuilder/test-failing-project/pom.xml
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] test-plugin-dep .................................... SUCCESS [  1.583 s]
[INFO] test-parent ........................................ SUCCESS [  0.215 s]
[INFO] test-failing-project ............................... FAILURE [  0.163 s]
[INFO] test-rootbuilder ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.166 s
[INFO] Finished at: 2015-01-10T14:11:00+01:00
[INFO] Final Memory: 12M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check (default) on project test-failing-project: Execution default of goal org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check failed: Found project reference to test:test-plugin-dep:jar:0.0.1-SNAPSHOT but no repo reference! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check (default) on project test-failing-project: Execution default of goal org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check failed: Found project reference to test:test-plugin-dep:jar:0.0.1-SNAPSHOT but no repo reference!
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.basepom.maven:duplicate-finder-maven-plugin:1.1.0:check failed: Found project reference to test:test-plugin-dep:jar:0.0.1-SNAPSHOT but no repo reference!
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.IllegalStateException: Found project reference to test:test-plugin-dep:jar:0.0.1-SNAPSHOT but no repo reference!
    at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
    at org.basepom.mojo.duplicatefinder.artifact.ArtifactFileResolver.<init>(ArtifactFileResolver.java:87)
    at org.basepom.mojo.duplicatefinder.DuplicateFinderMojo.execute(DuplicateFinderMojo.java:300)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    ... 20 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :test-failing-project

I have no extra repositories in my settings.xml neither.

@hgschmie
Copy link
Contributor

thanks, I will take a look

@hgschmie
Copy link
Contributor

Ok, I see what is going on. The failing dependency is not a project dependency but hides inside a plugin (in this case, the compiler plugin). Not sure what do to here. The plugin must either ignore the dependency (bad, because you may end up compiling against something that is duplicate) or find the location.

@victornoel
Copy link
Author

Normally the various classpaths (compile, runtime, etc...) of the project,
against which the user classes are compiled, does not include the plugins'
classpaths, so you can ignore safely this dependency I think!
But it is true that the plugin will see both this dependency and the
compile dependency of the project... But that's another concern.
Le 18 janv. 2015 04:49, "Henning Schmiedehausen" notifications@github.com
a écrit :

Ok, I see what is going on. The failing dependency is not a project
dependency but hides inside a plugin (in this case, the compiler plugin).
Not sure what do to here. The plugin must either ignore the dependency
(bad, because you may end up compiling against something that is duplicate)
or find the location.


Reply to this email directly or view it on GitHub
#9 (comment)
.

@hgschmie
Copy link
Contributor

Yes, that is the problem. :-) A project referenced from a plugin classpath is added to the project.getProjectReferences() map even though it is not actually on the project classpath.

@hgschmie
Copy link
Contributor

Fixed in 943ecef, will be released in 1.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants