On 22 Apr 07, at 5:23 PM 22 Apr 07, gilclark wrote:


There is some work being done to the shade plugin so that might be it. I
froze the version of that plugin to 1.0-alpha-4 which helped me.


The shade plugin wouldn't have anything to do with the assembly plugin build. It's not used there.

Specify the version of the assembly plugin you want to use, and you probably want 2.1 which was the release before 2.2-beta-1.

You've hit a bug with the new version of the assembly plugin. This is why it is good to specify the versions of plugins you are using. Your builds probably updated to the latest version of the assembly plugin.

Please give us a build that is representative of your build so that we can fix it.

Thanks,

Jason.


Jose Alberto Fernandez wrote:

Hi guys, I posted this on the user list but got no answers. It is an
urgent matter as it is affecting some of our developers that are unable to build the project anymore while others can. Talking about unreproducible
builds.

We are getting the following stack-trace while executing the
assembly:directory goal.

The artifact com.cellectivity:fattoush-test-shared is declared on the
module POMs as:

    <dependency>
      <groupId>com.cellectivity</groupId>
      <artifactId>fattoush-test-shared</artifactId>
      <scope>test</scope>
      <version>[1.0,)</version>
      <type>test-jar</type>
    </dependency>

As it is needed only for testing. Notice that the version is required by MVN and if I ask for the specific current version $ {project.version} MVN complaints it cannot find it. Eventhough it is one of the artifacts that
is building.

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
  <parent>
    <groupId>com.cellectivity</groupId>
    <artifactId>fattoush</artifactId>
    <version>1.5.2-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>fattoush-test-shared</artifactId>
  <packaging>jar</packaging>
  <name>Fattoush Test Shared</name>
  <dependencies>
  <dependency>
      <groupId>com.cellectivity</groupId>
      <artifactId>fattoush-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.cellectivity</groupId>
      <artifactId>fattoush-module-constant</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-jar-plugin</artifactId>
       <executions>
         <execution>
           <goals>
             <goal>test-jar</goal>
           </goals>
         </execution>
       </executions>
     </plugin>
    </plugins>
  </build>
 </project>

when we execute mvn install everything works, but if we do mvn install
assembly:directory it fails during assembly. the stack-trace is as
follows:

[INFO] [assembly:directory]
[INFO] Reading assembly descriptor:
D:\fattoush\mvn\fattoush\assembly\assembly-live.xml
[WARNING] NOTE: Currently, inclusion of module dependencies may produce
unpredictable results if a version conflict occu rs.
[INFO] Processing DependencySet (output=${version}/lib) [INFO]
--------------------------------------------------------------------- ---
[ERROR] FATAL ERROR
[INFO]
--------------------------------------------------------------------- ---
[INFO] version was null for com.cellectivity:fattoush-test-shared
[INFO]
--------------------------------------------------------------------- ---
[INFO] Trace
java.lang.NullPointerException: version was null for
com.cellectivity:fattoush-test-shared
        at
org.apache.maven.artifact.DefaultArtifact.getBaseVersion (DefaultArtifact.java:364)
        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:344)
        at
org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolver.r esolveDependencies(DefaultDependencyReso
lver.java:82)
        at
org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.r esolveDependencyArtifacts(AddDependencyS
etsTask.java:155)
        at
org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.a ddDependencySet(AddDependencySetsTask.ja
va:100)
        at
org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.e xecute(AddDependencySetsTask.java:90)
        at
org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPhase .addModuleBinaries(ModuleSetAssemblyPhas
e.java:198)
        at
org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPhase .execute(ModuleSetAssemblyPhase.java:91)

        at
org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.crea teArchive(DefaultAssemblyArchiver.java:9
8)
        at
org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.createDi rectory(AbstractDirectoryMojo.java:79)
        at
org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.execute( AbstractDirectoryMojo.java:57)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:420)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:493)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.jav
a:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:224)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:330) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 123)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
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:585)
        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 interesting part of the assembly descriptor is:

  <moduleSets>
    <moduleSet>
      <includes>
        <include>com.cellectivity:fattoush-app-portal</include>
      </includes>
      <binaries>
        <outputDirectory>${version}/lib</outputDirectory>
        <includeDependencies>true</includeDependencies>
        <unpack>false</unpack>
      </binaries>
    </moduleSet>
  </moduleSets>

Funny enough the error only happens consistently on certain machines and not in others. I am able to build, but one of my co-workers cannot, same branch. So much about reproducible builds. We have even tried copying my
local repository into his local repository to see if it made any
difference; try deleting his repository completely; but nothing helps.

Any clues on what can be going wrong, will be appreciated.



--
View this message in context: http://www.nabble.com/ NullPointerException-during-maven-assembly-plugin- tf3624104s177.html#a10128693
Sent from the Maven Developers mailing list archive at Nabble.com.


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




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

Reply via email to