Hi,

so after diving into this problem... (https://issues.apache.org/jira/browse/MNG-5895)...

I have found the culprit (in my opinion) at Maven-assembly-plugin located in this class DefaultDependencyResolver:

at the following method:


    private Set<Artifact> resolveTransitively(
final Set<Artifact> dependencyArtifacts,
final List<ArtifactRepository> repos,
final ResolutionManagementInfo info,
final AssemblerConfigurationSource configSource )
 throws DependencyResolutionException
    {
        final MavenProject project = configSource.getProject();

        final ArtifactFilter filter = info.getScopeFilter();

        ArtifactResolutionRequest req = new ArtifactResolutionRequest();
        req.setLocalRepository( configSource.getLocalRepository() );
        req.setResolveRoot( false );
        req.setRemoteRepositories( repos );
        req.setResolveTransitively( true );
        req.setArtifact( project.getArtifact() );
        req.setArtifactDependencies( dependencyArtifacts );
        req.setManagedVersionMap( project.getManagedVersionMap() );
        req.setCollectionFilter( filter );
        req.setOffline( configSource.getMavenSession().isOffline() );
req.setForceUpdate( configSource.getMavenSession().getRequest().isUpdateSnapshots() ); req.setServers( configSource.getMavenSession().getRequest().getServers() ); req.setMirrors( configSource.getMavenSession().getRequest().getMirrors() ); req.setProxies( configSource.getMavenSession().getRequest().getProxies() );

        ArtifactResolutionResult result;

        result = resolver.resolve( req );
        if ( result.hasExceptions() )
        {
throw new DependencyResolutionException( "Failed to resolve dependencies for assembly: ",

result.getExceptions().get( 0 ) );
        }

FilterUtils.reportFilteringStatistics( Collections.singleton( filter ), getLogger() );

        return result.getArtifacts();
    }



And the identified line is:

        result = resolver.resolve( req );

which fails to find the appropriate dependencies...or better the wrong version of the dependencies....


So I'm not sure at the moment if this is based on Maven 2 compatibility of maven-assembly-plugin or if there is an other issue in there or I'm just simply wrong...

WDYT ?


Kind regards
Karl Heinz Marbaise



On 8/23/15 5:16 PM, Karl Heinz Marbaise wrote:
Hi,

I have test project where i defined the pom like this:

...
   <modelVersion>4.0.0</modelVersion>

   <groupId>com.soebes.examples.j2ee</groupId>
   <artifactId>parent</artifactId>
   <version>${revision}</version>
   <packaging>pom</packaging>

If i define the revision on command line like this.

mvn -Drevision=1.0-SNAPSHOT clean package

everything fine...

But now i want to make the usage a bit more convenient so i added the
following to my pom:


   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <revision>1.0-SNAPSHOT</revision>
   </properties>

to have a default for revision which works fine now...

But if i would like to overwrite the property from command line like this:

mvn -Drevision=1.0 clean package

the build failes in the following location:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-assembly-plugin:2.5.5:single (assemblies)
on project assembly: Failed to create assembly: Unable to resolve
dependencies for assembly 'archive': Failed to resolve dependencies for
assembly: Unable to get dependency information for
com.soebes.examples.j2ee:service-client:jar:1.0-SNAPSHOT: Failed to
process POM for
com.soebes.examples.j2ee:service-client:jar:1.0-SNAPSHOT: Non-resolvable
parent POM for
com.soebes.examples.j2ee:service-client:[unknown-version]: Failure to
find com.soebes.examples.j2ee:parent:pom:${revision} in
http://localhost:8081/nexus/content/groups/public was cached in the
local repository, resolution will not be reattempted until the update
interval of nexus has elapsed or updates are forced
[ERROR] com.soebes.examples.j2ee:service-client:jar:1.0-SNAPSHOT

The project is available on github
(https://github.com/khmarbaise/javaee/tree/mvn321)....

So the question which is coming up...is this based on Maven core or is
this based on maven-assembly-plugin ?

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to