You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Logan Allred <re...@gmail.com> on 2009/06/03 23:38:32 UTC

Problem with artifact resolution in Maven 2.1.0

We're in the process of upgrading Maven to 2.1.0 from 2.0.9, and our
build is not working (it uses the Flexmojos plugin). I can see how it
fails, but I don't understand why it only fails in Maven 2.1.0.
Perusing the release notes did not seem to indicate anything obvious
as to why the behavior change, but I don't understand Maven internals
that well.

When run in 2.0.9 I get this output:
.....
[DEBUG]   com.example.project:libC:rb.swc:1.0.2-SNAPSHOT:compile
(selected for compile)
.....
[DEBUG] libA: using locally installed snapshot
[DEBUG] libB: using locally installed snapshot
[DEBUG] libC: using locally installed snapshot
[DEBUG] getResourcesBundles([Ljava.lang.String;@557a2adf) returning
resourceBundles: [.....,
/Users/logan/.m2/repository/com/example/project/libA/1.0.2-SNAPSHOT/libA-1.0.2-SNAPSHOT-en_US.rb.swc,
/Users/logan/.m2/repository/com/example/project/libB/1.0.2-SNAPSHOT/libB-1.0.2-SNAPSHOT-en_US.rb.swc,
/Users/logan/.m2/repository/com/example/project/libC/1.0.2-SNAPSHOT/libC-1.0.2-SNAPSHOT-en_US.rb.swc,.....]

However, when running from 2.1.0 I get this output:
[DEBUG]   com.example.project:libC:resource-bundle:1.0.2-SNAPSHOT:compile
(selected for compile)
.....
[DEBUG] libA: using locally installed snapshot
[DEBUG] libB: using locally installed snapshot
[DEBUG] getResourcesBundles([Ljava.lang.String;@2ff3376a) returning
resourceBundles: [.....,
/Users/logan/.m2/repository/com/example/project/libA/1.0.2-SNAPSHOT/libA-1.0.2-SNAPSHOT-en_US.rb.swc,
/Users/logan/.m2/repository/com/example/project/libB/1.0.2-SNAPSHOT/libB-1.0.2-SNAPSHOT-en_US.rb.swc,.....]

Notice that 2.1.0 shows the coordinate type as resource-bundle but
2.0.9 has it as rb.swc, 2.1.0 also does not have the message:
[DEBUG] libC: using locally installed snapshot
and the plugin debug message about getResourcesBundles does not include libC.

The getResourcesBundles() method eventually calls:
resolver.resolveTransitively( project.getDependencyArtifacts(),
project.getArtifact(),
                                              remoteRepositories,
localRepository, artifactMetadataSource );
(resolver is of type ArtifactResolver)
and then filters out all of the artifacts that aren't rb.swc.

Does anyone understand why the 2.1.0 behavior is different, and what
needs to be done to get it resolved (fix pom, fix Flexmojos, log bug
against Maven 2.1.0)?

thanks,
Logan

MORE PROJECT INFO:
We are using the Flexmojos maven plugin, which has a special packaging
type (from components.xml):
    <component>
      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
      <role-hint>resource-bundle</role-hint>
      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
      <configuration>
        <type>resource-bundle</type>
        <extension>rb.swc</extension>
        <includesDependencies>false</includesDependencies>
        <language>actionscript</language>
        <addedToClasspath>false</addedToClasspath>
      </configuration>
    </component>

Then these artifacts are looked up like this:
resolver.resolveTransitively( project.getDependencyArtifacts(),
project.getArtifact(),
                                              remoteRepositories,
localRepository, artifactMetadataSource );
resolver is of type ArtifactResolver.

We have a multi-module build:

<modules>
  <module>libA</module>
  <module>libB</module>
  <module>libC</module>
	.....
  <module>app</module>
</modules>

app depends on libC and libB, and libC depends on libB and libA etc.:
(from app pom.xml):
	<dependency>
	  <groupId>com.example.project</groupId>
	  <artifactId>libB</artifactId>
	  <version>1.0.2-SNAPSHOT</version>
	  <type>swc</type>
	</dependency>
	<dependency>
	  <groupId>com.example.project</groupId>
	  <artifactId>libB</artifactId>
	  <version>1.0.2-SNAPSHOT</version>
	  <type>rb.swc</type>
	</dependency>
    <dependency>
      <groupId>com.example.project</groupId>
      <artifactId>libC</artifactId>
      <version>1.0.2-SNAPSHOT</version>
      <type>swc</type>
    </dependency>
    <dependency>
      <groupId>com.example.project</groupId>
      <artifactId>libC</artifactId>
      <version>1.0.2-SNAPSHOT</version>
      <type>rb.swc</type>
    </dependency>

(from libC pom.xml):
	<dependency>
	  <groupId>com.example.project</groupId>
	  <artifactId>libA</artifactId>
	  <version>1.0.2-SNAPSHOT</version>
	  <type>swc</type>
	</dependency>
	<dependency>
	  <groupId>com.example.project</groupId>
	  <artifactId>libA</artifactId>
	  <version>1.0.2-SNAPSHOT</version>
	  <type>rb.swc</type>
	</dependency>
	<dependency>
	  <groupId>com.example.project</groupId>
	  <artifactId>libB</artifactId>
	  <version>1.0.2-SNAPSHOT</version>
	  <type>swc</type>
	</dependency>
	<dependency>
	  <groupId>com.example.project</groupId>
	  <artifactId>libB</artifactId>
	  <version>1.0.2-SNAPSHOT</version>
	  <type>rb.swc</type>
	</dependency>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org