You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jose Alberto Fernandez <jo...@cellectivity.com> on 2007/04/21 21:01:05 UTC

NullPointerException during maven-assembly-plugin

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.resolveDependencies(DefaultDependencyReso
lver.java:82)
        at
org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.resolveDependencyArtifacts(AddDependencyS
etsTask.java:155)
        at
org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.addDependencySet(AddDependencySetsTask.ja
va:100)
        at
org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.execute(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.createArchive(DefaultAssemblyArchiver.java:9
8)
        at
org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.createDirectory(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.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(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#a10120032
Sent from the Maven Developers mailing list archive at Nabble.com.


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


RE: NullPointerException during maven-assembly-plugin

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
That's why it's a best-practice to specify in your pom what version to
use. See the other threads on this list regarding the topic. We are
discussing making this a requirement in 2.1, but haven't settled on a
single strategy yet. 

-----Original Message-----
From: Jose Alberto Fernandez [mailto:jose@cellectivity.com] 
Sent: Tuesday, April 24, 2007 10:27 AM
To: dev@maven.apache.org
Subject: RE: NullPointerException during maven-assembly-plugin


Whoa! That is really an unexpected behaviour. Seems to be asking for
teams to get in trouble FAST.
This make the works of a team highly non-deterministic as users can get
in this bad state not even realizing it.

Jose Alberto


Brian E. Fox wrote:
> 
> Jose,
> Maven only updates plugins if you don't have the plugin or if you 
> specify -U on the command line. This means if you haven't specified a 
> specific version in your pom, Maven will use the latest version of 
> each plugin _in your local repository_. That's how different computers

> can get out of sync. It's also why you should specify in your pom, 
> because then you are guaranteed to have a consistent version across 
> your teams (and reproducible in the future).
> 
> --Brian
> 
> -----Original Message-----
> From: Jose Alberto Fernandez [mailto:jose@cellectivity.com]
> Sent: Tuesday, April 24, 2007 8:18 AM
> To: dev@maven.apache.org
> Subject: RE: NullPointerException during maven-assembly-plugin
> 
> 
> Hi all, as promised I changed the POMs to specify version 2.1 of the 
> assembly plug-in and now things seem to be working on the machines 
> that were not working before. So this seem to have solved the problem.
> 
> It does not explain why we do not have the same behaviour in all 
> computers as we all use the same settings , as far as I can tell.
> 
> In any case there seems to be an issue on maven-assembly-plugin:2.2 
> when dealing with test only dependencies. In particular if the 
> dependency only constructs a test-jar and hence is not a regular jar
artefact.
> 
> Thanks for your help.
> 
> Jose Alberto
> 
> 
> Jose Alberto Fernandez wrote:
>> 
>> I will go and specify the versions. 
>> 
>> 
>> Brian E. Fox wrote:
>>> 
>>> If you haven't specified the version of the plugin in your pom, then

>>> the version each developer has can be different. See the other 
>>> threads on this list for more info.
>>> 
>>> -----Original Message-----
>>> From: Jose Alberto Fernandez [mailto:jose@cellectivity.com]
>>> Sent: Monday, April 23, 2007 8:36 AM
>>> To: dev@maven.apache.org
>>> Subject: Re: NullPointerException during maven-assembly-plugin
>>> 
>>> 
>>> We are quite simple maven users here. We all installed maven 2.0.5, 
>>> our project code and POMs are on SVN. We do not build any maven 
>>> component from source and using the same settings. And we all run 
>>> maven from the same recipe of commands that we more or less cut and 
>>> paste like:
>>> 
>>> mvn install assembly:directory -Dlive
>>> 
>>> or
>>> 
>>> mvn -Dproject.test.skip=false install assembly:directory -Dlive
>>> 
>>> Nothing fancy.
>>> 
>>> 
>>> Jason van Zyl-2 wrote:
>>>> 
>>>> 
>>>> If you all share a single configuration then they should behave 
>>>> them
> 
>>>> same. If some developers have different update policies then some 
>>>> users will download new versions and some won't. If some have built

>>>> from trunk then some will have yet again a different version. The 
>>>> only way to lock it down is to specify the version. The assembly 
>>>> plugin was released on the 11th it appears:
>>>> 
>>>> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assemb
>>>> l
>>>> y-
>>> 
>>>> plugin/
>>>> 
>>>>> As per a reproducible example, this is exactly the main issue we 
>>>>> are having, we cannot even reproduce the error across our 
>>>>> environments here.
>>>> 
>>>> 
>>> 
>>> Will try fixing to 2.1 and will let you know.
>>> 
>>> 
>>> Jason van Zyl-2 wrote:
>>>> 
>>>> When you specify a version?
>>>> 
>>>>> We are all
>>>>> running maven 2.0.5 and we are all building out of the same source

>>>>> on SVN.
>>>> 
>>> 
>>> Will let you know...
>>>>
>>>>
>>>>
>>>> Jason van Zyl-2 wrote:
>>>>>
>>>>> 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.incl
>>>>>>> u
>>>>>>> de
>>>>>>> (ScopeArtifactFilter.java:142)
>>>>>>>         at
>>>>>>> org.apache.maven.project.artifact.MavenMetadataSource.createArti
>>>>>>> f
>>>>>>> ac
>>> 
>>>>>>> ts
>>>>>>> (MavenMetadataSource.java:344)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.artifact.DefaultDependencyResol
>>>>>>> v
>>>>>>> er
>>> 
>>>>>>> .r
>>>>>>> esolveDependencies(DefaultDependencyReso
>>>>>>> lver.java:82)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsT
>>>>>>> a
>>>>>>> sk
>>> 
>>>>>>> .r
>>>>>>> esolveDependencyArtifacts(AddDependencyS
>>>>>>> etsTask.java:155)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsT
>>>>>>> a
>>>>>>> sk
>>> 
>>>>>>> .a
>>>>>>> ddDependencySet(AddDependencySetsTask.ja
>>>>>>> va:100)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsT
>>>>>>> a
>>>>>>> sk
>>> 
>>>>>>> .e
>>>>>>> xecute(AddDependencySetsTask.java:90)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssembly
>>>>>>> P
>>>>>>> ha
>>> 
>>>>>>> se
>>>>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>>>>> e.java:198)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssembly
>>>>>>> P
>>>>>>> ha
>>> 
>>>>>>> se
>>>>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>>>>
>>>>>>>         at
>>>>>>>
org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.
>>>>>>> cr
>>> 
>>>>>>> ea
>>>>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>>>>> 8)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.cre
>>>>>>> a
>>>>>>> te
>>> 
>>>>>>> Di
>>>>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.exe
>>>>>>> c
>>>>>>> ut
>>> 
>>>>>>> e(
>>>>>>> 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.executeStand
>>>>>>> a
>>>>>>> lo
>>> 
>>>>>>> ne
>>>>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>>>>         at
>>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>>>>> (DefaultLifecycleExecutor.java:463)
>>>>>>>         at
>>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalA
>>>>>>> n
>>>>>>> dH
>>> 
>>>>>>> an
>>>>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>>>>> a:311)
>>>>>>>         at
>>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskS
>>>>>>> e
>>>>>>> gm
>>> 
>>>>>>> en
>>>>>>> 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: dev-unsubscribe@maven.apache.org For 
>>>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> -
>>>>> -- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context: http://www.nabble.com/
>>>> NullPointerException-during-maven-assembly-plugin-
>>>> tf3624104s177.html#a10138035
>>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> - To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>> 
>>> 
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>> additional commands, e-mail: dev-help@maven.apache.org
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://www.nabble.com/NullPointerException-during-maven-assembly-plu
>>> g
>>> in-
>>> tf3624104s177.html#a10139230
>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>> 
>>> 
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>> additional commands, e-mail: dev-help@maven.apache.org
>>> 
>>> 
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>> additional commands, e-mail: dev-help@maven.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/NullPointerException-during-maven-assembly-plugi
> n-
> tf3624104s177.html#a10159805
> Sent from the Maven Developers mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
> additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
> additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 

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


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


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


RE: NullPointerException during maven-assembly-plugin

Posted by Jose Alberto Fernandez <jo...@cellectivity.com>.
Whoa! That is really an unexpected behaviour. Seems to be asking for teams to
get in trouble FAST.
This make the works of a team highly non-deterministic as users can get in
this bad state not even realizing it.

Jose Alberto


Brian E. Fox wrote:
> 
> Jose,
> Maven only updates plugins if you don't have the plugin or if you
> specify -U on the command line. This means if you haven't specified a
> specific version in your pom, Maven will use the latest version of each
> plugin _in your local repository_. That's how different computers can
> get out of sync. It's also why you should specify in your pom, because
> then you are guaranteed to have a consistent version across your teams
> (and reproducible in the future). 
> 
> --Brian 
> 
> -----Original Message-----
> From: Jose Alberto Fernandez [mailto:jose@cellectivity.com] 
> Sent: Tuesday, April 24, 2007 8:18 AM
> To: dev@maven.apache.org
> Subject: RE: NullPointerException during maven-assembly-plugin
> 
> 
> Hi all, as promised I changed the POMs to specify version 2.1 of the
> assembly plug-in and now things seem to be working on the machines that
> were not working before. So this seem to have solved the problem.
> 
> It does not explain why we do not have the same behaviour in all
> computers as we all use the same settings , as far as I can tell.
> 
> In any case there seems to be an issue on maven-assembly-plugin:2.2 when
> dealing with test only dependencies. In particular if the dependency
> only constructs a test-jar and hence is not a regular jar artefact.
> 
> Thanks for your help.
> 
> Jose Alberto
> 
> 
> Jose Alberto Fernandez wrote:
>> 
>> I will go and specify the versions. 
>> 
>> 
>> Brian E. Fox wrote:
>>> 
>>> If you haven't specified the version of the plugin in your pom, then 
>>> the version each developer has can be different. See the other 
>>> threads on this list for more info.
>>> 
>>> -----Original Message-----
>>> From: Jose Alberto Fernandez [mailto:jose@cellectivity.com]
>>> Sent: Monday, April 23, 2007 8:36 AM
>>> To: dev@maven.apache.org
>>> Subject: Re: NullPointerException during maven-assembly-plugin
>>> 
>>> 
>>> We are quite simple maven users here. We all installed maven 2.0.5, 
>>> our project code and POMs are on SVN. We do not build any maven 
>>> component from source and using the same settings. And we all run 
>>> maven from the same recipe of commands that we more or less cut and 
>>> paste like:
>>> 
>>> mvn install assembly:directory -Dlive
>>> 
>>> or
>>> 
>>> mvn -Dproject.test.skip=false install assembly:directory -Dlive
>>> 
>>> Nothing fancy.
>>> 
>>> 
>>> Jason van Zyl-2 wrote:
>>>> 
>>>> 
>>>> If you all share a single configuration then they should behave them
> 
>>>> same. If some developers have different update policies then some 
>>>> users will download new versions and some won't. If some have built 
>>>> from trunk then some will have yet again a different version. The 
>>>> only way to lock it down is to specify the version. The assembly 
>>>> plugin was released on the 11th it appears:
>>>> 
>>>> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembl
>>>> y-
>>> 
>>>> plugin/
>>>> 
>>>>> As per a reproducible example, this is exactly the main issue we 
>>>>> are having, we cannot even reproduce the error across our 
>>>>> environments here.
>>>> 
>>>> 
>>> 
>>> Will try fixing to 2.1 and will let you know.
>>> 
>>> 
>>> Jason van Zyl-2 wrote:
>>>> 
>>>> When you specify a version?
>>>> 
>>>>> We are all
>>>>> running maven 2.0.5 and we are all building out of the same source 
>>>>> on SVN.
>>>> 
>>> 
>>> Will let you know...
>>>>
>>>>
>>>>
>>>> Jason van Zyl-2 wrote:
>>>>>
>>>>> 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.inclu
>>>>>>> de
>>>>>>> (ScopeArtifactFilter.java:142)
>>>>>>>         at
>>>>>>> org.apache.maven.project.artifact.MavenMetadataSource.createArtif
>>>>>>> ac
>>> 
>>>>>>> ts
>>>>>>> (MavenMetadataSource.java:344)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolv
>>>>>>> er
>>> 
>>>>>>> .r
>>>>>>> esolveDependencies(DefaultDependencyReso
>>>>>>> lver.java:82)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTa
>>>>>>> sk
>>> 
>>>>>>> .r
>>>>>>> esolveDependencyArtifacts(AddDependencyS
>>>>>>> etsTask.java:155)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTa
>>>>>>> sk
>>> 
>>>>>>> .a
>>>>>>> ddDependencySet(AddDependencySetsTask.ja
>>>>>>> va:100)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTa
>>>>>>> sk
>>> 
>>>>>>> .e
>>>>>>> xecute(AddDependencySetsTask.java:90)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyP
>>>>>>> ha
>>> 
>>>>>>> se
>>>>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>>>>> e.java:198)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyP
>>>>>>> ha
>>> 
>>>>>>> se
>>>>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>>>>
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.
>>>>>>> cr
>>> 
>>>>>>> ea
>>>>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>>>>> 8)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.crea
>>>>>>> te
>>> 
>>>>>>> Di
>>>>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>>>>         at
>>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.exec
>>>>>>> ut
>>> 
>>>>>>> e(
>>>>>>> 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.executeStanda
>>>>>>> lo
>>> 
>>>>>>> ne
>>>>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>>>>         at
>>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>>>>> (DefaultLifecycleExecutor.java:463)
>>>>>>>         at
>>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAn
>>>>>>> dH
>>> 
>>>>>>> an
>>>>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>>>>> a:311)
>>>>>>>         at
>>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSe
>>>>>>> gm
>>> 
>>>>>>> en
>>>>>>> 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: dev-unsubscribe@maven.apache.org For 
>>>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------
>>>>> -- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context: http://www.nabble.com/
>>>> NullPointerException-during-maven-assembly-plugin-
>>>> tf3624104s177.html#a10138035
>>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> - To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>> additional commands, e-mail: dev-help@maven.apache.org
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://www.nabble.com/NullPointerException-during-maven-assembly-plug
>>> in-
>>> tf3624104s177.html#a10139230
>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>> additional commands, e-mail: dev-help@maven.apache.org
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>> additional commands, e-mail: dev-help@maven.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/NullPointerException-during-maven-assembly-plugin-
> tf3624104s177.html#a10159805
> Sent from the Maven Developers mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 

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


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


RE: NullPointerException during maven-assembly-plugin

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Jose,
Maven only updates plugins if you don't have the plugin or if you
specify -U on the command line. This means if you haven't specified a
specific version in your pom, Maven will use the latest version of each
plugin _in your local repository_. That's how different computers can
get out of sync. It's also why you should specify in your pom, because
then you are guaranteed to have a consistent version across your teams
(and reproducible in the future). 

--Brian 

-----Original Message-----
From: Jose Alberto Fernandez [mailto:jose@cellectivity.com] 
Sent: Tuesday, April 24, 2007 8:18 AM
To: dev@maven.apache.org
Subject: RE: NullPointerException during maven-assembly-plugin


Hi all, as promised I changed the POMs to specify version 2.1 of the
assembly plug-in and now things seem to be working on the machines that
were not working before. So this seem to have solved the problem.

It does not explain why we do not have the same behaviour in all
computers as we all use the same settings , as far as I can tell.

In any case there seems to be an issue on maven-assembly-plugin:2.2 when
dealing with test only dependencies. In particular if the dependency
only constructs a test-jar and hence is not a regular jar artefact.

Thanks for your help.

Jose Alberto


Jose Alberto Fernandez wrote:
> 
> I will go and specify the versions. 
> 
> 
> Brian E. Fox wrote:
>> 
>> If you haven't specified the version of the plugin in your pom, then 
>> the version each developer has can be different. See the other 
>> threads on this list for more info.
>> 
>> -----Original Message-----
>> From: Jose Alberto Fernandez [mailto:jose@cellectivity.com]
>> Sent: Monday, April 23, 2007 8:36 AM
>> To: dev@maven.apache.org
>> Subject: Re: NullPointerException during maven-assembly-plugin
>> 
>> 
>> We are quite simple maven users here. We all installed maven 2.0.5, 
>> our project code and POMs are on SVN. We do not build any maven 
>> component from source and using the same settings. And we all run 
>> maven from the same recipe of commands that we more or less cut and 
>> paste like:
>> 
>> mvn install assembly:directory -Dlive
>> 
>> or
>> 
>> mvn -Dproject.test.skip=false install assembly:directory -Dlive
>> 
>> Nothing fancy.
>> 
>> 
>> Jason van Zyl-2 wrote:
>>> 
>>> 
>>> If you all share a single configuration then they should behave them

>>> same. If some developers have different update policies then some 
>>> users will download new versions and some won't. If some have built 
>>> from trunk then some will have yet again a different version. The 
>>> only way to lock it down is to specify the version. The assembly 
>>> plugin was released on the 11th it appears:
>>> 
>>> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembl
>>> y-
>> 
>>> plugin/
>>> 
>>>> As per a reproducible example, this is exactly the main issue we 
>>>> are having, we cannot even reproduce the error across our 
>>>> environments here.
>>> 
>>> 
>> 
>> Will try fixing to 2.1 and will let you know.
>> 
>> 
>> Jason van Zyl-2 wrote:
>>> 
>>> When you specify a version?
>>> 
>>>> We are all
>>>> running maven 2.0.5 and we are all building out of the same source 
>>>> on SVN.
>>> 
>> 
>> Will let you know...
>>>
>>>
>>>
>>> Jason van Zyl-2 wrote:
>>>>
>>>> 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.inclu
>>>>>> de
>>>>>> (ScopeArtifactFilter.java:142)
>>>>>>         at
>>>>>> org.apache.maven.project.artifact.MavenMetadataSource.createArtif
>>>>>> ac
>> 
>>>>>> ts
>>>>>> (MavenMetadataSource.java:344)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolv
>>>>>> er
>> 
>>>>>> .r
>>>>>> esolveDependencies(DefaultDependencyReso
>>>>>> lver.java:82)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTa
>>>>>> sk
>> 
>>>>>> .r
>>>>>> esolveDependencyArtifacts(AddDependencyS
>>>>>> etsTask.java:155)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTa
>>>>>> sk
>> 
>>>>>> .a
>>>>>> ddDependencySet(AddDependencySetsTask.ja
>>>>>> va:100)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTa
>>>>>> sk
>> 
>>>>>> .e
>>>>>> xecute(AddDependencySetsTask.java:90)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyP
>>>>>> ha
>> 
>>>>>> se
>>>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>>>> e.java:198)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyP
>>>>>> ha
>> 
>>>>>> se
>>>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>>>
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.
>>>>>> cr
>> 
>>>>>> ea
>>>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>>>> 8)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.crea
>>>>>> te
>> 
>>>>>> Di
>>>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.exec
>>>>>> ut
>> 
>>>>>> e(
>>>>>> 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.executeStanda
>>>>>> lo
>> 
>>>>>> ne
>>>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>>>         at
>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>>>> (DefaultLifecycleExecutor.java:463)
>>>>>>         at
>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAn
>>>>>> dH
>> 
>>>>>> an
>>>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>>>> a:311)
>>>>>>         at
>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSe
>>>>>> gm
>> 
>>>>>> en
>>>>>> 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: dev-unsubscribe@maven.apache.org For 
>>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>>> additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/
>>> NullPointerException-during-maven-assembly-plugin-
>>> tf3624104s177.html#a10138035
>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>>> additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>> additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://www.nabble.com/NullPointerException-during-maven-assembly-plug
>> in-
>> tf3624104s177.html#a10139230
>> Sent from the Maven Developers mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>> additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
>> additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 
>> 
> 
> 

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


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


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


RE: NullPointerException during maven-assembly-plugin

Posted by Jose Alberto Fernandez <jo...@cellectivity.com>.
Hi all, as promised I changed the POMs to specify version 2.1 of the assembly
plug-in and now things seem to be working on the machines that were not
working before. So this seem to have solved the problem.

It does not explain why we do not have the same behaviour in all computers
as we all use the same settings , as far as I can tell.

In any case there seems to be an issue on maven-assembly-plugin:2.2 when
dealing with test only dependencies. In particular if the dependency only
constructs a test-jar and hence is not a regular jar artefact.

Thanks for your help.

Jose Alberto


Jose Alberto Fernandez wrote:
> 
> I will go and specify the versions. 
> 
> 
> Brian E. Fox wrote:
>> 
>> If you haven't specified the version of the plugin in your pom, then the
>> version each developer has can be different. See the other threads on
>> this list for more info.
>> 
>> -----Original Message-----
>> From: Jose Alberto Fernandez [mailto:jose@cellectivity.com] 
>> Sent: Monday, April 23, 2007 8:36 AM
>> To: dev@maven.apache.org
>> Subject: Re: NullPointerException during maven-assembly-plugin
>> 
>> 
>> We are quite simple maven users here. We all installed maven 2.0.5, our
>> project code and POMs are on SVN. We do not build any maven component
>> from
>> source and using the same settings. And we all run maven from the same
>> recipe of commands that we more or less cut and paste like:
>> 
>> mvn install assembly:directory -Dlive
>> 
>> or
>> 
>> mvn -Dproject.test.skip=false install assembly:directory -Dlive
>> 
>> Nothing fancy.
>> 
>> 
>> Jason van Zyl-2 wrote:
>>> 
>>> 
>>> If you all share a single configuration then they should behave them  
>>> same. If some developers have different update policies then some  
>>> users will download new versions and some won't. If some have built  
>>> from trunk then some will have yet again a different version. The  
>>> only way to lock it down is to specify the version. The assembly  
>>> plugin was released on the 11th it appears:
>>> 
>>> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-
>> 
>>> plugin/
>>> 
>>>> As per a reproducible example, this is exactly the main issue we  
>>>> are having,
>>>> we cannot even reproduce the error across our environments here.
>>> 
>>> 
>> 
>> Will try fixing to 2.1 and will let you know.
>> 
>> 
>> Jason van Zyl-2 wrote:
>>> 
>>> When you specify a version?
>>> 
>>>> We are all
>>>> running maven 2.0.5 and we are all building out of the same source  
>>>> on SVN.
>>> 
>> 
>> Will let you know...
>>>
>>>
>>>
>>> Jason van Zyl-2 wrote:
>>>>
>>>> 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.createArtifac
>> 
>>>>>> ts
>>>>>> (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.ModuleSetAssemblyPha
>> 
>>>>>> se
>>>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>>>> e.java:198)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPha
>> 
>>>>>> se
>>>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>>>
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.cr
>> 
>>>>>> ea
>>>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>>>> 8)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.create
>> 
>>>>>> Di
>>>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>>>         at
>>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.execut
>> 
>>>>>> e(
>>>>>> 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.executeStandalo
>> 
>>>>>> ne
>>>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>>>         at
>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>>>> (DefaultLifecycleExecutor.java:463)
>>>>>>         at
>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndH
>> 
>>>>>> an
>>>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>>>> a:311)
>>>>>>         at
>>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegm
>> 
>>>>>> en
>>>>>> 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: dev-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>>>
>>>
>>> -- 
>>> View this message in context: http://www.nabble.com/ 
>>> NullPointerException-during-maven-assembly-plugin- 
>>> tf3624104s177.html#a10138035
>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/NullPointerException-during-maven-assembly-plugin-
>> tf3624104s177.html#a10139230
>> Sent from the Maven Developers mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 
>> 
> 
> 

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


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


RE: NullPointerException during maven-assembly-plugin

Posted by Jose Alberto Fernandez <jo...@cellectivity.com>.
I will go and specify the versions. 

But isn't maven suppose to look for and upgrade to the latest version,
unless I say otherwise, every time I run maven? 

Or is this something done on a random basis? I get more and more confuse by
the minute on how maven is suppose to behave.

Jose A.


Brian E. Fox wrote:
> 
> If you haven't specified the version of the plugin in your pom, then the
> version each developer has can be different. See the other threads on
> this list for more info.
> 
> -----Original Message-----
> From: Jose Alberto Fernandez [mailto:jose@cellectivity.com] 
> Sent: Monday, April 23, 2007 8:36 AM
> To: dev@maven.apache.org
> Subject: Re: NullPointerException during maven-assembly-plugin
> 
> 
> We are quite simple maven users here. We all installed maven 2.0.5, our
> project code and POMs are on SVN. We do not build any maven component
> from
> source and using the same settings. And we all run maven from the same
> recipe of commands that we more or less cut and paste like:
> 
> mvn install assembly:directory -Dlive
> 
> or
> 
> mvn -Dproject.test.skip=false install assembly:directory -Dlive
> 
> Nothing fancy.
> 
> 
> Jason van Zyl-2 wrote:
>> 
>> 
>> If you all share a single configuration then they should behave them  
>> same. If some developers have different update policies then some  
>> users will download new versions and some won't. If some have built  
>> from trunk then some will have yet again a different version. The  
>> only way to lock it down is to specify the version. The assembly  
>> plugin was released on the 11th it appears:
>> 
>> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-
> 
>> plugin/
>> 
>>> As per a reproducible example, this is exactly the main issue we  
>>> are having,
>>> we cannot even reproduce the error across our environments here.
>> 
>> 
> 
> Will try fixing to 2.1 and will let you know.
> 
> 
> Jason van Zyl-2 wrote:
>> 
>> When you specify a version?
>> 
>>> We are all
>>> running maven 2.0.5 and we are all building out of the same source  
>>> on SVN.
>> 
> 
> Will let you know...
>>
>>
>>
>> Jason van Zyl-2 wrote:
>>>
>>> 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.createArtifac
> 
>>>>> ts
>>>>> (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.ModuleSetAssemblyPha
> 
>>>>> se
>>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>>> e.java:198)
>>>>>         at
>>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPha
> 
>>>>> se
>>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>>
>>>>>         at
>>>>> org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.cr
> 
>>>>> ea
>>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>>> 8)
>>>>>         at
>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.create
> 
>>>>> Di
>>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>>         at
>>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.execut
> 
>>>>> e(
>>>>> 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.executeStandalo
> 
>>>>> ne
>>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>>         at
>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>>> (DefaultLifecycleExecutor.java:463)
>>>>>         at
>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndH
> 
>>>>> an
>>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>>> a:311)
>>>>>         at
>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegm
> 
>>>>> en
>>>>> 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: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/ 
>> NullPointerException-during-maven-assembly-plugin- 
>> tf3624104s177.html#a10138035
>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/NullPointerException-during-maven-assembly-plugin-
> tf3624104s177.html#a10139230
> Sent from the Maven Developers mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 

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


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


RE: NullPointerException during maven-assembly-plugin

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
If you haven't specified the version of the plugin in your pom, then the
version each developer has can be different. See the other threads on
this list for more info.

-----Original Message-----
From: Jose Alberto Fernandez [mailto:jose@cellectivity.com] 
Sent: Monday, April 23, 2007 8:36 AM
To: dev@maven.apache.org
Subject: Re: NullPointerException during maven-assembly-plugin


We are quite simple maven users here. We all installed maven 2.0.5, our
project code and POMs are on SVN. We do not build any maven component
from
source and using the same settings. And we all run maven from the same
recipe of commands that we more or less cut and paste like:

mvn install assembly:directory -Dlive

or

mvn -Dproject.test.skip=false install assembly:directory -Dlive

Nothing fancy.


Jason van Zyl-2 wrote:
> 
> 
> If you all share a single configuration then they should behave them  
> same. If some developers have different update policies then some  
> users will download new versions and some won't. If some have built  
> from trunk then some will have yet again a different version. The  
> only way to lock it down is to specify the version. The assembly  
> plugin was released on the 11th it appears:
> 
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-

> plugin/
> 
>> As per a reproducible example, this is exactly the main issue we  
>> are having,
>> we cannot even reproduce the error across our environments here.
> 
> 

Will try fixing to 2.1 and will let you know.


Jason van Zyl-2 wrote:
> 
> When you specify a version?
> 
>> We are all
>> running maven 2.0.5 and we are all building out of the same source  
>> on SVN.
> 

Will let you know...
>
>
>
> Jason van Zyl-2 wrote:
>>
>> 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.createArtifac

>>>> ts
>>>> (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.ModuleSetAssemblyPha

>>>> se
>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>> e.java:198)
>>>>         at
>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPha

>>>> se
>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>
>>>>         at
>>>> org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.cr

>>>> ea
>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>> 8)
>>>>         at
>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.create

>>>> Di
>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>         at
>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.execut

>>>> e(
>>>> 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.executeStandalo

>>>> ne
>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>> (DefaultLifecycleExecutor.java:463)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndH

>>>> an
>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>> a:311)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegm

>>>> en
>>>> 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: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/ 
> NullPointerException-during-maven-assembly-plugin- 
> tf3624104s177.html#a10138035
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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




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


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


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


Re: NullPointerException during maven-assembly-plugin

Posted by Jose Alberto Fernandez <jo...@cellectivity.com>.
We are quite simple maven users here. We all installed maven 2.0.5, our
project code and POMs are on SVN. We do not build any maven component from
source and using the same settings. And we all run maven from the same
recipe of commands that we more or less cut and paste like:

mvn install assembly:directory -Dlive

or

mvn -Dproject.test.skip=false install assembly:directory -Dlive

Nothing fancy.


Jason van Zyl-2 wrote:
> 
> 
> If you all share a single configuration then they should behave them  
> same. If some developers have different update policies then some  
> users will download new versions and some won't. If some have built  
> from trunk then some will have yet again a different version. The  
> only way to lock it down is to specify the version. The assembly  
> plugin was released on the 11th it appears:
> 
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly- 
> plugin/
> 
>> As per a reproducible example, this is exactly the main issue we  
>> are having,
>> we cannot even reproduce the error across our environments here.
> 
> 

Will try fixing to 2.1 and will let you know.


Jason van Zyl-2 wrote:
> 
> When you specify a version?
> 
>> We are all
>> running maven 2.0.5 and we are all building out of the same source  
>> on SVN.
> 

Will let you know...
>
>
>
> Jason van Zyl-2 wrote:
>>
>> 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.createArtifac 
>>>> ts
>>>> (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.ModuleSetAssemblyPha 
>>>> se
>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>> e.java:198)
>>>>         at
>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPha 
>>>> se
>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>
>>>>         at
>>>> org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.cr 
>>>> ea
>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>> 8)
>>>>         at
>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.create 
>>>> Di
>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>         at
>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.execut 
>>>> e(
>>>> 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.executeStandalo 
>>>> ne
>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>> (DefaultLifecycleExecutor.java:463)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndH 
>>>> an
>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>> a:311)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegm 
>>>> en
>>>> 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: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/ 
> NullPointerException-during-maven-assembly-plugin- 
> tf3624104s177.html#a10138035
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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




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


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


Re: NullPointerException during maven-assembly-plugin

Posted by Jason van Zyl <ja...@maven.org>.
On 23 Apr 07, at 7:25 AM 23 Apr 07, Jose Alberto Fernandez wrote:

>
> Hi Jason,
>
> When was 2.2-beta-1 released? This problem has been happening for  
> several
> days on one of my co-workers machine. However it does not occurs on  
> some
> other machines. Since maven should have upgraded all machines or  
> none, I do
> not see how this can be a version issue.
>

If you all share a single configuration then they should behave them  
same. If some developers have different update policies then some  
users will download new versions and some won't. If some have built  
from trunk then some will have yet again a different version. The  
only way to lock it down is to specify the version. The assembly  
plugin was released on the 11th it appears:

http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly- 
plugin/

> As per a reproducible example, this is exactly the main issue we  
> are having,
> we cannot even reproduce the error across our environments here.

When you specify a version?

> We are all
> running maven 2.0.5 and we are all building out of the same source  
> on SVN.

Same source of what? You app, Maven plugins?

> The full build has more than twenty components with complex  
> relationships
> and as this is a corporate project I am not in liberty of sending  
> you the
> full code.

I didn't ask for you code I asked you for something that represents  
what you're doing. Making something so we can reproduce the problem  
is half the battle.

>
> As I mentioned below, the only special thing we are doing is  
> constructing a
> test-jar for the module that fails and no regular jar. In the POM we
> indicate that the dependency in only for testing. Could it be that  
> if tests
> are skipped then assembly will not find the corresponding test-jar and
> complain?
>
> Has anyone seen anything remotely similar. Can someone tell when  
> one is
> supposed to get the exception below?
> I will try posting any workarounds I am able to find, but some  
> guidance on
> what kind of thing can be going wrong will be appreciated.

Lock down your version to 2.1 and let us know if you still have the  
problem.

Jason.

>
>
>
> Jason van Zyl-2 wrote:
>>
>> 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.createArtifac 
>>>> ts
>>>> (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.ModuleSetAssemblyPha 
>>>> se
>>>> .addModuleBinaries(ModuleSetAssemblyPhas
>>>> e.java:198)
>>>>         at
>>>> org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPha 
>>>> se
>>>> .execute(ModuleSetAssemblyPhase.java:91)
>>>>
>>>>         at
>>>> org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.cr 
>>>> ea
>>>> teArchive(DefaultAssemblyArchiver.java:9
>>>> 8)
>>>>         at
>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.create 
>>>> Di
>>>> rectory(AbstractDirectoryMojo.java:79)
>>>>         at
>>>> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.execut 
>>>> e(
>>>> 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.executeStandalo 
>>>> ne
>>>> Goal(DefaultLifecycleExecutor.java:493)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>>> (DefaultLifecycleExecutor.java:463)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndH 
>>>> an
>>>> dleFailures(DefaultLifecycleExecutor.jav
>>>> a:311)
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegm 
>>>> en
>>>> 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: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/ 
> NullPointerException-during-maven-assembly-plugin- 
> tf3624104s177.html#a10138035
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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


Re: NullPointerException during maven-assembly-plugin

Posted by Jose Alberto Fernandez <jo...@cellectivity.com>.
Hi Jason,

When was 2.2-beta-1 released? This problem has been happening for several
days on one of my co-workers machine. However it does not occurs on some
other machines. Since maven should have upgraded all machines or none, I do
not see how this can be a version issue.

As per a reproducible example, this is exactly the main issue we are having,
we cannot even reproduce the error across our environments here. We are all
running maven 2.0.5 and we are all building out of the same source on SVN.
The full build has more than twenty components with complex relationships
and as this is a corporate project I am not in liberty of sending you the
full code.

As I mentioned below, the only special thing we are doing is constructing a
test-jar for the module that fails and no regular jar. In the POM we
indicate that the dependency in only for testing. Could it be that if tests
are skipped then assembly will not find the corresponding test-jar and
complain? 

Has anyone seen anything remotely similar. Can someone tell when one is
supposed to get the exception below?
I will try posting any workarounds I am able to find, but some guidance on
what kind of thing can be going wrong will be appreciated.



Jason van Zyl-2 wrote:
> 
> 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: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 

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


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


Re: NullPointerException during maven-assembly-plugin

Posted by Jason van Zyl <ja...@maven.org>.
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: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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


Re: NullPointerException during maven-assembly-plugin

Posted by gilclark <gi...@intuit.com>.
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.


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.resolveDependencies(DefaultDependencyReso
> lver.java:82)
>         at
> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.resolveDependencyArtifacts(AddDependencyS
> etsTask.java:155)
>         at
> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.addDependencySet(AddDependencySetsTask.ja
> va:100)
>         at
> org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.execute(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.createArchive(DefaultAssemblyArchiver.java:9
> 8)
>         at
> org.apache.maven.plugin.assembly.mojos.AbstractDirectoryMojo.createDirectory(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.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
> a:311)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org