Closed rnc closed 4 years ago
Thank you for the report. The problem seems to be that some reactor projects output multiple artifacts with different classifiers, but the go-offline-plugin only recognises the main artifact as a "reactor artifact". Could be tricky to resolve. I am looking into it.
@Theoderich I haven't tried it but could getAttachedArtifacts
be used to compute what is in the reactor?
getAttachedArtifacts unfortunately does not output the correct information since the attached artifacts are only added when the custom maven-jar-plugin execution runs...
I have pushed a new version to the master branch that should fix the problem by no longer taking type and classifier into consideration when determining if an artifact is part of the reactor build. I think it is fair to assume that all artifacts with the same groupId:artifactId:version identifier are created by the same maven project.
Can you build an test the new version of the plugin to confirm that it works for you?
@Theoderich Nice! That works. However I think have found another problem. I had to add some error logging in https://github.com/qaware/go-offline-maven-plugin/blob/master/src/main/java/de/qaware/maven/plugin/offline/DependencyDownloader.java#L211 (to get the stack trace), but once I had done that I found (using the same example above):
org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.jboss.da:reports-model:jar:1.7.0
.....
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Failure to find org.jboss.bom:jboss-eap-javaee7-with-tools:pom:7.1.2.GA in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Now, while org.jboss.bom:jboss-eap-javaee7-with-tools:pom:7.1.2.GA
is not in central, that referring pom does have a parent that has a repositories section (https://github.com/project-ncl/dependency-analysis/blob/1.7.0/pom.xml#L296) that gives the correct repository. At a guess - is the resolver configured to use repositories (and for repositories found in the inheritance? )
So we have a dependency (org.jboss.da:reports-model) that has a parent (org.jboss.da:parent) that has a dependency (org.jboss.bom:jboss-eap-javaee7-with-tools) that is not in maven central. But org.jboss.da:parent defines that repository. Phew!
The go-offline plugin does take repostories into account, but not those of external dependencies. But indeed mvn install
resolves those dependencies correctly. Looking into it
@Theoderich Phew indeed! Hopefully my explanation made sense :-D As https://github.com/release-engineering/pom-manipulation-ext is public it should be possible to reproduce locally.
That was easier than expected! The flag "IgnoreArtifactDescriptorRepositories" was actually hard set to "true" by the plugin instead of using the value provided by maven. At the time I thought that would be the correct behaviour, but as your example demonstrates maven actually does use repositories from dependencies. So using the maven provided value for "IgnoreArtifactDescriptorRepositories" should be the right thing to do.
Please test if the new push fixes the issue on your side :)
Perfect! That does fix it :-) Nice!
I'll do some testing and release the new version 1.2.4. Thanks for your report :)
1.2.4 is released on maven central
I am seeing failures like:
from running
with Maven 3.6.2. I am using repository https://github.com/release-engineering/pom-manipulation-ext with SHA db3be6d3668250e9f72be0b45c1f0e67f0fd936e on branch master.