Hi,

I'm using a version range to include packages in a bundle using the maven assembly plugin. It's detecting the right versions, but it gives the following warnings followed by an error:


[WARNING] Cannot include project artifact: org.trege:org.trege.product.product.updatesite:pom:6.2.1.0; it doesn't have an associated file or directory. [WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.thirdparty:6.2.1.2) of type: jar; constructing POM
artifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.core.ui:6.2.1.1) of type: jar; constructing POM art
ifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.packager:6.2.1.1) of type: jar; constructing POM ar
tifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.packager.ui:6.2.1.1) of type: jar; constructing POM
artifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.test.core:6.2.1.1) of type: jar; constructing POM a
rtifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.test.plugins:6.2.1.1) of type: jar; constructing PO
M artifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.test.ui:6.2.1.1) of type: jar; constructing POM art
ifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.validation.core:6.2.1.1) of type: jar; constructing
POM artifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.validation.plugins:6.2.1.1) of type: jar; construct
ing POM artifact instead.
[WARNING] Attempting to build MavenProject instance for Artifact (org.trege:org.trege.product.validation.ui:6.2.1.1) of type: jar; constructing P
OM artifact instead.


java.lang.NullPointerException: version was null for org.trege:org.trege.product.thirdparty at org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifact.java:362) at org.apache.maven.artifact.DefaultArtifact.getId(DefaultArtifact.java:225) at org.apache.maven.shared.artifact.filter.ScopeArtifactFilter.include(ScopeArtifactFilter.java:142) at org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:357) at org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolver.resolveDependencies(DefaultDependencyResolver.java:123) at org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.resolveDependencyArtifacts(AddDependencySetsTask.java:205) at org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.addDependencySet(AddDependencySetsTask.java:132) at org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.execute(AddDependencySetsTask.java:116) at org.apache.maven.plugin.assembly.archive.phase.DependencySetAssemblyPhase.execute(DependencySetAssemblyPhase.java:74) at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:129) at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:322) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


The first warning is expected, but the last few only appeared when I switched to using a version range. I use the range [6.2.1.0, 6.2.2.0] and every other maven script for build of the individual plugins doesn't have a problem.

Alternatively, is there a way to access the version detected specifically at run-time? Eg ${pom.dependancy.org.trege.product.thirdparty.version}? I've read the documentation and not find anything, but it would be helpful if there were an undocumented way of doing this, so I could specify it manually. These are incremental builds, so being forced to manually increment could be an issue. All versions are defined in the parent pom file with the following form:

   <dependencyManagement>
       <dependencies>
           <dependency>
               <groupId>org.trege</groupId>
               <artifactId>org.trege.product.thirdparty</artifactId>
               <version>[6.2.1.0, 6.2.2.0]</version>
               <scope>provided</scope>
               <optional>true</optional>
               <type>jar</type>
           </dependency>
       </dependencies>
   </dependencyManagement>

And in the child pom as follows:

   <dependencies>
       <dependency>
           <groupId>org.trege</groupId>
           <artifactId>org.trege.product.thirdparty</artifactId>
       </dependency>
   </dependencies>

Thanks,
Trevor


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to