[ 
https://jira.codehaus.org/browse/MASSEMBLY-556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=303496#comment-303496
 ] 

Hal Deadman commented on MASSEMBLY-556:
---------------------------------------

I am getting this same NPE when I try to create an assembly with a maven 
repository in it using the assembly plugin's <repositories> tag. I am using 
Maven 3.0.3 and assembly plugin 2.3. 

Other assemblies (non-repositories) are working. The culprit does appear to be 
the mirror entry in settings.xml, although I had to use a settings.xml that 
didn't have a mirror and add a repositories section to my pom.xml: 


{code}
<repositories>
     <repository>
        <id>nexus</id>
        <url>http://XYZ.PDQ/nexus/content/groups/public</url>
        <releases>
           <enabled>true</enabled>
        </releases>
        <snapshots>
          <enabled>false</enabled>
        </snapshots>        
    </repository>
</repositories>
{code}

The assembly descriptor I am using looks like this:
{code}
<assembly 
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
 http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
  <id>repository</id>
  <formats>
    <format>zip</format>
  </formats>
  <repositories>
    <repository>
      <scope>runtime</scope>
      <includeMetadata>true</includeMetadata>
      <outputDirectory>maven2</outputDirectory>
    </repository>
  </repositories>
</assembly>
{code}

If settings.xml has a mirror, I get the NPE. If I don't have a mirror I have to 
add the repositories section to my pom.xml because Maven tries to re-download 
things that it can't find unless I point the application at our nexus server 
(rather than relying on a mirror of * to point at our nexus server). I have all 
the dependencies in my local repo so I am not sure why it is trying to download 
anything.
                
> mvn assembly:assembly NPEs with install:install-file'd artifacts
> ----------------------------------------------------------------
>
>                 Key: MASSEMBLY-556
>                 URL: https://jira.codehaus.org/browse/MASSEMBLY-556
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2-beta-5
>         Environment: Maven 3.0.3 (r1075438; 2011-02-28 17:31:09+0000) on Win 
> 7 x64, Sun Java 6u24 x64.
>            Reporter: Chris West (Faux)
>            Assignee: John Casey
>         Attachments: build.log, massembly-556-2.tar.gz, massembly-556.tar.gz, 
> pom.xml, repository.xml
>
>
> I have 3rd-party jars installed via. {{mvn install:install-file}}.  This 
> causes {{mvn assembly:assembly}} to NPE around:
> {code}
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.maven.artifact.repository.metadata.AbstractRepositoryMetadata.getLocalFilename(AbstractRepositoryMetadata.java:61)
>       at 
> org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout.pathOfLocalRepositoryMetadata(DefaultRepositoryLayout.java:72)
> ...
> {code}
> To reproduce, first, install:install-file a random file:
> {code}
> mvn install:install-file -Dfile=pom.xml -DgroupId=com.goeswhere.test 
> -DartifactId=a -Dversion=0 -Dpackaging=jar
> {code}
> Then, create pom.xml (attached):
> {code:xml}
> <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/xsd/maven-4.0.0.xsd";>
>       <modelVersion>4.0.0</modelVersion>
>       <groupId>com.goeswhere.test</groupId>
>       <artifactId>b</artifactId>
>       <version>1.0-SNAPSHOT</version>
>       <packaging>jar</packaging>
>       <dependencies>
>               <dependency>
>                       <groupId>com.goeswhere.test</groupId>
>                       <artifactId>a</artifactId>
>                       <version>0</version>
>               </dependency>
>       </dependencies>
>       <build>
>               <plugins>
>                       <plugin>
>                               <artifactId>maven-assembly-plugin</artifactId>
>                               <configuration>
>                                       <descriptors>
>                                               
> <descriptor>./repository.xml</descriptor>
>                                       </descriptors>
>                               </configuration>
>                       </plugin>
>               </plugins>
>       </build>
> </project>
> {code}
> and repository.xml (attached):
> {code:xml}
> <assembly
>       
> xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       
> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
>  http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
>       <id>repository</id>
>       <formats>
>               <format>jar</format>
>       </formats>
>       <repositories>
>               <repository>
>                       <includeMetadata>true</includeMetadata>
>                       <outputDirectory>maven2</outputDirectory>
>               </repository>
>       </repositories>
> </assembly>
> {code}
> And run {{mvn assembly:assembly}}.  See attached build.log.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to