You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Algie Morgan <mo...@iodp.tamu.edu> on 2009/05/20 22:15:18 UTC

FATAL ERROR: id can not be null

I apologize if this question has already been asked.  I have searched the recent archives and did not find it.

I have a project that compiled fine under Maven 2.0.6.  I recently upgraded to Maven 2.1.0 and it returned this error when I tried to compile:


[INFO] Copying 10 resources
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] id can not be null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException: id can not be null
        at org.apache.maven.wagon.repository.Repository.<init>(Repository.java:8
1)
        at org.apache.maven.artifact.repository.DefaultArtifactRepository.<init>
(DefaultArtifactRepository.java:70)
        at org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory
.createDeploymentArtifactRepository(DefaultArtifactRepositoryFactory.java:44)
        at org.apache.maven.project.ProjectUtils.buildDeploymentArtifactReposito
ry(ProjectUtils.java:80)
        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLog
ic(DefaultMavenProjectBuilder.java:1038)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(Def
aultMavenProjectBuilder.java:880)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromReposito
ry(DefaultMavenProjectBuilder.java:255)
        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
edProject(MavenMetadataSource.java:163)
        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
edArtifact(MavenMetadataSource.java:94)
        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(D
efaultArtifactCollector.java:388)
        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(D
efaultArtifactCollector.java:74)

...


My POM file is:

<?xml version="1.0"?><project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.myorg</groupId>
  <artifactId>my-main-project</artifactId>
  <name>my-main-project</name>
  <version>1.1</version>
  <url>http://maven.apache.org</url>
  <build>
    <finalName>my-main-project</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <!--plugin>
        <groupId>org.myorg</groupId>
        <artifactId>maven-file-plugin</artifactId>
      </plugin-->
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>maven2.org.myorg</id>
      <name>My Maven2 Repository</name>
      <url>http://myorg.org/maven2</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>maven2.myorg.org</id>
      <url>http://myorg.org/maven2</url>
    </pluginRepository>
  </pluginRepositories>
  <dependencies>
    <dependency>
      <groupId>jdbc</groupId>
      <artifactId>oracle</artifactId>
      <version>1.4</version>
    </dependency>
    <dependency>
      <groupId>org.myorg</groupId>
      <artifactId>some_service</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.myorg</groupId>
      <artifactId>utils</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.15</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>jdom</groupId>
      <artifactId>jdom</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
    	<groupId>commons-httpclient</groupId>
    	<artifactId>commons-httpclient</artifactId>
    	<version>3.1</version>
    </dependency>
    <dependency>
    	<groupId>org.myorg</groupId>
    	<artifactId>some_java_service</artifactId>
    	<version>1.9</version>
    </dependency>
  </dependencies>
  <distributionManagement>
    <repository>
    	<id>org.myorg</id>
      <url>scp://127.0.0.1/srv/www/htdocs/maven2</url>
      <!--url>scp://myorg.org/srv/www/htdocs/maven2</url-->
    </repository>
    <site>
    	<id>myorg.org</id>
      <url>scp://myorg.org/home/public_html/my-main-project</url>
    </site>
  </distributionManagement>
</project>



I would appreciate any advice you can give with this problem.



Algie Morgan
Senior Software Developer
Integrated Ocean Drilling Program
Texas  A & M University


Algie E. Morgan
Software Developer
Department: Tools and Analytical Services (TAS)
 
 morgan_a@iodp.tamu.edu
Office: 979-845-1125
Cell: 979-571-7973
 


RE: FATAL ERROR: id can not be null

Posted by Martin Gainty <mg...@hotmail.com>.
Here is a pom.xml which contains a mandatory <id> element

</mailingList>
</mailingLists>
<developers>
<developer>
<id>mraible</id>
<name>Matt Raible</name>
<email>matt@raibledesigns.com</email>
<organization>Raible Designs, Inc.</organization>
<timezone>-7</timezone>
</developer>

if i left out <id>mraible</id>
maven execution would fail

so examine all the elements in your pom.xml and 
determine which ones need <id> element
and insert <id>SomeValidId</id>accordingly

HTH
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Wed, 20 May 2009 16:27:39 -0500
> From: morgan_a@iodp.tamu.edu
> To: users@maven.apache.org
> Subject: Re: FATAL ERROR: id can not be null
> 
>  Olivier,
> 
> Thanks for your fast response, but that is not the problem.  I checked the ~/.m2/settings.xml and that all checks out fine.  There were only a few entries there for a jetspeed project I am experimenting with.  I tried commenting out most of that file and I still get the error.  But, just in case I overlooked something, here is the settings.xml file:
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> Licensed to the Apache Software Foundation (ASF) under one or more
> contributor license agreements.  See the NOTICE file distributed with
> this work for additional information regarding copyright ownership.
> The ASF licenses this file to You under the Apache License, Version 2.0
> (the "License"); you may not use this file except in compliance with
> the License.  You may obtain a copy of the License at
> 
>     http://www.apache.org/licenses/LICENSE-2.0 
> 
> Unless required by applicable law or agreed to in writing, software
> distributed under the License is distributed on an "AS IS" BASIS,
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> See the License for the specific language governing permissions and
> limitations under the License.
> 
>   $Id:$
> -->
> 
> <!--
>     settings.xml
> 
>     This file is placed in ~/.m2 by convention. User defined
>     profiles must be defined or extended with these settings
>     to perform a complete J2 build and deployment.
> -->
> <settings xmlns="http://maven.apache.org/POM/4.0.0">
> 
>     <profiles>
> 
>         <!-- Default Profile -->
>         <profile>
>             <id>settings</id>
>             <activation>
>                 <activeByDefault>true</activeByDefault>
>             </activation>
>             <properties>
>     
>                 <!-- Jetspeed-2 deployment properties -->
> 
>                 <org.apache.jetspeed.server.home>C:\Program Files\Apache Software Foundation\Tomcat-5.5.27</org.apache.jetspeed.server.home>
>                 <org.apache.jetspeed.catalina.version.major>5.5</org.apache.jetspeed.catalina.version.major>
>                 <org.apache.jetspeed.services.autodeployment.server>localhost</org.apache.jetspeed.services.autodeployment.server>
>                 <org.apache.jetspeed.services.autodeployment.port>8080</org.apache.jetspeed.services.autodeployment.port>
>                 <org.apache.jetspeed.services.autodeployment.user>user</org.apache.jetspeed.services.autodeployment.user>
>                 <org.apache.jetspeed.services.autodeployment.password>password</org.apache.jetspeed.services.autodeployment.password>
>                 
>                 <!-- Derby embedded database properties -->
> 
>                 <org.apache.jetspeed.production.jdbc.drivers.path></org.apache.jetspeed.production.jdbc.drivers.path>
>                 <org.apache.jetspeed.production.database.default.name>derby</org.apache.jetspeed.production.database.default.name>
>                 <org.apache.jetspeed.production.database.url>jdbc:derby:/tmp/j2</org.apache.jetspeed.production.database.url>
>                 <org.apache.jetspeed.production.database.driver>org.apache.derby.jdbc.EmbeddedDriver</org.apache.jetspeed.production.database.driver>
>                 <org.apache.jetspeed.production.database.user></org.apache.jetspeed.production.database.user>
>                 <org.apache.jetspeed.production.database.password></org.apache.jetspeed.production.database.password>
> 
>                 <!-- MSSQL database properties -->
> 
>                 <!--
>                 <org.apache.jetspeed.production.jdbc.drivers.path>${org.apache.jetspeed.server.home}/shared/lib/jtds-1.2.jar</org.apache.jetspeed.production.jdbc.drivers.path>
>                 <org.apache.jetspeed.production.database.default.name>mssql</org.apache.jetspeed.production.database.default.name>
>                 <org.apache.jetspeed.production.database.url>jdbc:jtds:sqlserver://localhost:1433/j2</org.apache.jetspeed.production.database.url>
>                 <org.apache.jetspeed.production.database.driver>net.sourceforge.jtds.jdbc.Driver</org.apache.jetspeed.production.database.driver>
>                 <org.apache.jetspeed.production.database.user>sa</org.apache.jetspeed.production.database.user>
>                 <org.apache.jetspeed.production.database.password>sa</org.apache.jetspeed.production.database.password>
>                 -->
> 
>                 <!-- HSQLDB embedded database properties -->
> 
>                 <!--
>                 <org.apache.jetspeed.production.jdbc.drivers.path></org.apache.jetspeed.production.jdbc.drivers.path>
>                 <org.apache.jetspeed.production.database.default.name>hsql</org.apache.jetspeed.production.database.default.name>
>                 <org.apache.jetspeed.production.database.url>jdbc:hsqldb:file:/tmp/j2;shutdown=true</org.apache.jetspeed.production.database.url>
>                 <org.apache.jetspeed.production.database.driver>org.hsqldb.jdbcDriver</org.apache.jetspeed.production.database.driver>
>                 <org.apache.jetspeed.production.database.user>sa</org.apache.jetspeed.production.database.user>
>                 <org.apache.jetspeed.production.database.password></org.apache.jetspeed.production.database.password>
>                 -->
>     
>             </properties>
>         </profile>
> 
>     </profiles>
> 
>     <activeProfiles>
> 
>         <!-- Derby embedded database properties -->
> 
>         <!-- activeProfile>jetspeed-db-embedded-derby</activeProfile -->
>         <!-- Drivers path configured database profile -->
> 
>         <!--
>         <activeProfile>jetspeed-db-drivers-path</activeProfile>
>         -->
> 
>         <!-- HSQLDB embedded database profile -->
> 
>         <!--
>         <activeProfile>jetspeed-db-embedded-hsql</activeProfile>
>         -->
> 
>     </activeProfiles>
> 
> </settings>
> 
> 
> Algie E. Morgan
> Software Developer
> Department: Tools and Analytical Services (TAS)
>  
>  morgan_a@iodp.tamu.edu
> Office: 979-845-1125
> Cell: 979-571-7973
>  
> 
> 
> >>> Olivier Lamy <ol...@apache.org> 5/20/2009 3:18 PM >>>
> Hi,
> Maybe a repository/mirror declared in ~/.m2/settings.xml without any id.
> 
> --
> Olivier
> 
> 2009/5/20 Algie Morgan <mo...@iodp.tamu.edu>:
> > I apologize if this question has already been asked.  I have searched the recent archives and did not find it.
> >
> > I have a project that compiled fine under Maven 2.0.6.  I recently upgraded to Maven 2.1.0 and it returned this error when I tried to compile:
> >
> >
> > [INFO] Copying 10 resources
> > [INFO] ------------------------------------------------------------------------
> > [ERROR] FATAL ERROR
> > [INFO] ------------------------------------------------------------------------
> > [INFO] id can not be null
> > [INFO] ------------------------------------------------------------------------
> > [INFO] Trace
> > java.lang.NullPointerException: id can not be null
> >        at org.apache.maven.wagon.repository.Repository.<init>(Repository.java:8
> > 1)
> >        at org.apache.maven.artifact.repository.DefaultArtifactRepository.<init>
> > (DefaultArtifactRepository.java:70)
> >        at org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory
> > .createDeploymentArtifactRepository(DefaultArtifactRepositoryFactory.java:44)
> >        at org.apache.maven.project.ProjectUtils.buildDeploymentArtifactReposito
> > ry(ProjectUtils.java:80)
> >        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLog
> > ic(DefaultMavenProjectBuilder.java:1038)
> >        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(Def
> > aultMavenProjectBuilder.java:880)
> >        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromReposito
> > ry(DefaultMavenProjectBuilder.java:255)
> >        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
> > edProject(MavenMetadataSource.java:163)
> >        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
> > edArtifact(MavenMetadataSource.java:94)
> >        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(D
> > efaultArtifactCollector.java:388)
> >        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(D
> > efaultArtifactCollector.java:74)
> >
> > ...
> >
> >
> > My POM file is:
> >
> > <?xml version="1.0"?><project>
> >  <modelVersion>4.0.0</modelVersion>
> >  <groupId>org.myorg</groupId>
> >  <artifactId>my-main-project</artifactId>
> >  <name>my-main-project</name>
> >  <version>1.1</version>
> >  <url>http://maven.apache.org</url>
> >  <build>
> >    <finalName>my-main-project</finalName>
> >    <plugins>
> >      <plugin>
> >        <artifactId>maven-compiler-plugin</artifactId>
> >        <configuration>
> >          <source>1.5</source>
> >          <target>1.5</target>
> >        </configuration>
> >      </plugin>
> >      <!--plugin>
> >        <groupId>org.myorg</groupId>
> >        <artifactId>maven-file-plugin</artifactId>
> >      </plugin-->
> >    </plugins>
> >  </build>
> >  <repositories>
> >    <repository>
> >      <id>maven2.org.myorg</id>
> >      <name>My Maven2 Repository</name>
> >      <url>http://myorg.org/maven2</url>
> >    </repository>
> >  </repositories>
> >  <pluginRepositories>
> >    <pluginRepository>
> >      <id>maven2.myorg.org</id>
> >      <url>http://myorg.org/maven2</url>
> >    </pluginRepository>
> >  </pluginRepositories>
> >  <dependencies>
> >    <dependency>
> >      <groupId>jdbc</groupId>
> >      <artifactId>oracle</artifactId>
> >      <version>1.4</version>
> >    </dependency>
> >    <dependency>
> >      <groupId>org.myorg</groupId>
> >      <artifactId>some_service</artifactId>
> >      <version>1.1</version>
> >    </dependency>
> >    <dependency>
> >      <groupId>org.json</groupId>
> >      <artifactId>json</artifactId>
> >      <version>1.0</version>
> >    </dependency>
> >    <dependency>
> >      <groupId>org.myorg</groupId>
> >      <artifactId>utils</artifactId>
> >      <version>1.2</version>
> >    </dependency>
> >    <dependency>
> >      <groupId>log4j</groupId>
> >      <artifactId>log4j</artifactId>
> >      <version>1.2.15</version>
> >      <scope>compile</scope>
> >    </dependency>
> >    <dependency>
> >      <groupId>jdom</groupId>
> >      <artifactId>jdom</artifactId>
> >      <version>1.0</version>
> >    </dependency>
> >    <dependency>
> >        <groupId>commons-httpclient</groupId>
> >        <artifactId>commons-httpclient</artifactId>
> >        <version>3.1</version>
> >    </dependency>
> >    <dependency>
> >        <groupId>org.myorg</groupId>
> >        <artifactId>some_java_service</artifactId>
> >        <version>1.9</version>
> >    </dependency>
> >  </dependencies>
> >  <distributionManagement>
> >    <repository>
> >        <id>org.myorg</id>
> >      <url>scp://127.0.0.1/srv/www/htdocs/maven2</url>
> >      <!--url>scp://myorg.org/srv/www/htdocs/maven2</url-->
> >    </repository>
> >    <site>
> >        <id>myorg.org</id>
> >      <url>scp://myorg.org/home/public_html/my-main-project</url>
> >    </site>
> >  </distributionManagement>
> > </project>
> >
> >
> >
> > I would appreciate any advice you can give with this problem.
> >
> >
> >
> > Algie Morgan
> > Senior Software Developer
> > Integrated Ocean Drilling Program
> > Texas  A & M University
> >
> >
> > Algie E. Morgan
> > Software Developer
> > Department: Tools and Analytical Services (TAS)
> >
> >  morgan_a@iodp.tamu.edu 
> > Office: 979-845-1125
> > Cell: 979-571-7973
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org 
> > For additional commands, e-mail: users-help@maven.apache.org 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org 
> For additional commands, e-mail: users-help@maven.apache.org 
> 

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009

Re: FATAL ERROR: id can not be null

Posted by Algie Morgan <mo...@iodp.tamu.edu>.
 Olivier,

Thanks for your fast response, but that is not the problem.  I checked the ~/.m2/settings.xml and that all checks out fine.  There were only a few entries there for a jetspeed project I am experimenting with.  I tried commenting out most of that file and I still get the error.  But, just in case I overlooked something, here is the settings.xml file:


<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0 

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

  $Id:$
-->

<!--
    settings.xml

    This file is placed in ~/.m2 by convention. User defined
    profiles must be defined or extended with these settings
    to perform a complete J2 build and deployment.
-->
<settings xmlns="http://maven.apache.org/POM/4.0.0">

    <profiles>

        <!-- Default Profile -->
        <profile>
            <id>settings</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
    
                <!-- Jetspeed-2 deployment properties -->

                <org.apache.jetspeed.server.home>C:\Program Files\Apache Software Foundation\Tomcat-5.5.27</org.apache.jetspeed.server.home>
                <org.apache.jetspeed.catalina.version.major>5.5</org.apache.jetspeed.catalina.version.major>
                <org.apache.jetspeed.services.autodeployment.server>localhost</org.apache.jetspeed.services.autodeployment.server>
                <org.apache.jetspeed.services.autodeployment.port>8080</org.apache.jetspeed.services.autodeployment.port>
                <org.apache.jetspeed.services.autodeployment.user>user</org.apache.jetspeed.services.autodeployment.user>
                <org.apache.jetspeed.services.autodeployment.password>password</org.apache.jetspeed.services.autodeployment.password>
                
                <!-- Derby embedded database properties -->

                <org.apache.jetspeed.production.jdbc.drivers.path></org.apache.jetspeed.production.jdbc.drivers.path>
                <org.apache.jetspeed.production.database.default.name>derby</org.apache.jetspeed.production.database.default.name>
                <org.apache.jetspeed.production.database.url>jdbc:derby:/tmp/j2</org.apache.jetspeed.production.database.url>
                <org.apache.jetspeed.production.database.driver>org.apache.derby.jdbc.EmbeddedDriver</org.apache.jetspeed.production.database.driver>
                <org.apache.jetspeed.production.database.user></org.apache.jetspeed.production.database.user>
                <org.apache.jetspeed.production.database.password></org.apache.jetspeed.production.database.password>

                <!-- MSSQL database properties -->

                <!--
                <org.apache.jetspeed.production.jdbc.drivers.path>${org.apache.jetspeed.server.home}/shared/lib/jtds-1.2.jar</org.apache.jetspeed.production.jdbc.drivers.path>
                <org.apache.jetspeed.production.database.default.name>mssql</org.apache.jetspeed.production.database.default.name>
                <org.apache.jetspeed.production.database.url>jdbc:jtds:sqlserver://localhost:1433/j2</org.apache.jetspeed.production.database.url>
                <org.apache.jetspeed.production.database.driver>net.sourceforge.jtds.jdbc.Driver</org.apache.jetspeed.production.database.driver>
                <org.apache.jetspeed.production.database.user>sa</org.apache.jetspeed.production.database.user>
                <org.apache.jetspeed.production.database.password>sa</org.apache.jetspeed.production.database.password>
                -->

                <!-- HSQLDB embedded database properties -->

                <!--
                <org.apache.jetspeed.production.jdbc.drivers.path></org.apache.jetspeed.production.jdbc.drivers.path>
                <org.apache.jetspeed.production.database.default.name>hsql</org.apache.jetspeed.production.database.default.name>
                <org.apache.jetspeed.production.database.url>jdbc:hsqldb:file:/tmp/j2;shutdown=true</org.apache.jetspeed.production.database.url>
                <org.apache.jetspeed.production.database.driver>org.hsqldb.jdbcDriver</org.apache.jetspeed.production.database.driver>
                <org.apache.jetspeed.production.database.user>sa</org.apache.jetspeed.production.database.user>
                <org.apache.jetspeed.production.database.password></org.apache.jetspeed.production.database.password>
                -->
    
            </properties>
        </profile>

    </profiles>

    <activeProfiles>

        <!-- Derby embedded database properties -->

        <!-- activeProfile>jetspeed-db-embedded-derby</activeProfile -->
        <!-- Drivers path configured database profile -->

        <!--
        <activeProfile>jetspeed-db-drivers-path</activeProfile>
        -->

        <!-- HSQLDB embedded database profile -->

        <!--
        <activeProfile>jetspeed-db-embedded-hsql</activeProfile>
        -->

    </activeProfiles>

</settings>


Algie E. Morgan
Software Developer
Department: Tools and Analytical Services (TAS)
 
 morgan_a@iodp.tamu.edu
Office: 979-845-1125
Cell: 979-571-7973
 


>>> Olivier Lamy <ol...@apache.org> 5/20/2009 3:18 PM >>>
Hi,
Maybe a repository/mirror declared in ~/.m2/settings.xml without any id.

--
Olivier

2009/5/20 Algie Morgan <mo...@iodp.tamu.edu>:
> I apologize if this question has already been asked.  I have searched the recent archives and did not find it.
>
> I have a project that compiled fine under Maven 2.0.6.  I recently upgraded to Maven 2.1.0 and it returned this error when I tried to compile:
>
>
> [INFO] Copying 10 resources
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] id can not be null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException: id can not be null
>        at org.apache.maven.wagon.repository.Repository.<init>(Repository.java:8
> 1)
>        at org.apache.maven.artifact.repository.DefaultArtifactRepository.<init>
> (DefaultArtifactRepository.java:70)
>        at org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory
> .createDeploymentArtifactRepository(DefaultArtifactRepositoryFactory.java:44)
>        at org.apache.maven.project.ProjectUtils.buildDeploymentArtifactReposito
> ry(ProjectUtils.java:80)
>        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLog
> ic(DefaultMavenProjectBuilder.java:1038)
>        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(Def
> aultMavenProjectBuilder.java:880)
>        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromReposito
> ry(DefaultMavenProjectBuilder.java:255)
>        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
> edProject(MavenMetadataSource.java:163)
>        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
> edArtifact(MavenMetadataSource.java:94)
>        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(D
> efaultArtifactCollector.java:388)
>        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(D
> efaultArtifactCollector.java:74)
>
> ...
>
>
> My POM file is:
>
> <?xml version="1.0"?><project>
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>org.myorg</groupId>
>  <artifactId>my-main-project</artifactId>
>  <name>my-main-project</name>
>  <version>1.1</version>
>  <url>http://maven.apache.org</url>
>  <build>
>    <finalName>my-main-project</finalName>
>    <plugins>
>      <plugin>
>        <artifactId>maven-compiler-plugin</artifactId>
>        <configuration>
>          <source>1.5</source>
>          <target>1.5</target>
>        </configuration>
>      </plugin>
>      <!--plugin>
>        <groupId>org.myorg</groupId>
>        <artifactId>maven-file-plugin</artifactId>
>      </plugin-->
>    </plugins>
>  </build>
>  <repositories>
>    <repository>
>      <id>maven2.org.myorg</id>
>      <name>My Maven2 Repository</name>
>      <url>http://myorg.org/maven2</url>
>    </repository>
>  </repositories>
>  <pluginRepositories>
>    <pluginRepository>
>      <id>maven2.myorg.org</id>
>      <url>http://myorg.org/maven2</url>
>    </pluginRepository>
>  </pluginRepositories>
>  <dependencies>
>    <dependency>
>      <groupId>jdbc</groupId>
>      <artifactId>oracle</artifactId>
>      <version>1.4</version>
>    </dependency>
>    <dependency>
>      <groupId>org.myorg</groupId>
>      <artifactId>some_service</artifactId>
>      <version>1.1</version>
>    </dependency>
>    <dependency>
>      <groupId>org.json</groupId>
>      <artifactId>json</artifactId>
>      <version>1.0</version>
>    </dependency>
>    <dependency>
>      <groupId>org.myorg</groupId>
>      <artifactId>utils</artifactId>
>      <version>1.2</version>
>    </dependency>
>    <dependency>
>      <groupId>log4j</groupId>
>      <artifactId>log4j</artifactId>
>      <version>1.2.15</version>
>      <scope>compile</scope>
>    </dependency>
>    <dependency>
>      <groupId>jdom</groupId>
>      <artifactId>jdom</artifactId>
>      <version>1.0</version>
>    </dependency>
>    <dependency>
>        <groupId>commons-httpclient</groupId>
>        <artifactId>commons-httpclient</artifactId>
>        <version>3.1</version>
>    </dependency>
>    <dependency>
>        <groupId>org.myorg</groupId>
>        <artifactId>some_java_service</artifactId>
>        <version>1.9</version>
>    </dependency>
>  </dependencies>
>  <distributionManagement>
>    <repository>
>        <id>org.myorg</id>
>      <url>scp://127.0.0.1/srv/www/htdocs/maven2</url>
>      <!--url>scp://myorg.org/srv/www/htdocs/maven2</url-->
>    </repository>
>    <site>
>        <id>myorg.org</id>
>      <url>scp://myorg.org/home/public_html/my-main-project</url>
>    </site>
>  </distributionManagement>
> </project>
>
>
>
> I would appreciate any advice you can give with this problem.
>
>
>
> Algie Morgan
> Senior Software Developer
> Integrated Ocean Drilling Program
> Texas  A & M University
>
>
> Algie E. Morgan
> Software Developer
> Department: Tools and Analytical Services (TAS)
>
>  morgan_a@iodp.tamu.edu 
> Office: 979-845-1125
> Cell: 979-571-7973
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org 
> For additional commands, e-mail: users-help@maven.apache.org 
>

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


Re: FATAL ERROR: id can not be null

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
Maybe a repository/mirror declared in ~/.m2/settings.xml without any id.

--
Olivier

2009/5/20 Algie Morgan <mo...@iodp.tamu.edu>:
> I apologize if this question has already been asked.  I have searched the recent archives and did not find it.
>
> I have a project that compiled fine under Maven 2.0.6.  I recently upgraded to Maven 2.1.0 and it returned this error when I tried to compile:
>
>
> [INFO] Copying 10 resources
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] id can not be null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException: id can not be null
>        at org.apache.maven.wagon.repository.Repository.<init>(Repository.java:8
> 1)
>        at org.apache.maven.artifact.repository.DefaultArtifactRepository.<init>
> (DefaultArtifactRepository.java:70)
>        at org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory
> .createDeploymentArtifactRepository(DefaultArtifactRepositoryFactory.java:44)
>        at org.apache.maven.project.ProjectUtils.buildDeploymentArtifactReposito
> ry(ProjectUtils.java:80)
>        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLog
> ic(DefaultMavenProjectBuilder.java:1038)
>        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(Def
> aultMavenProjectBuilder.java:880)
>        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromReposito
> ry(DefaultMavenProjectBuilder.java:255)
>        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
> edProject(MavenMetadataSource.java:163)
>        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocat
> edArtifact(MavenMetadataSource.java:94)
>        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(D
> efaultArtifactCollector.java:388)
>        at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(D
> efaultArtifactCollector.java:74)
>
> ...
>
>
> My POM file is:
>
> <?xml version="1.0"?><project>
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>org.myorg</groupId>
>  <artifactId>my-main-project</artifactId>
>  <name>my-main-project</name>
>  <version>1.1</version>
>  <url>http://maven.apache.org</url>
>  <build>
>    <finalName>my-main-project</finalName>
>    <plugins>
>      <plugin>
>        <artifactId>maven-compiler-plugin</artifactId>
>        <configuration>
>          <source>1.5</source>
>          <target>1.5</target>
>        </configuration>
>      </plugin>
>      <!--plugin>
>        <groupId>org.myorg</groupId>
>        <artifactId>maven-file-plugin</artifactId>
>      </plugin-->
>    </plugins>
>  </build>
>  <repositories>
>    <repository>
>      <id>maven2.org.myorg</id>
>      <name>My Maven2 Repository</name>
>      <url>http://myorg.org/maven2</url>
>    </repository>
>  </repositories>
>  <pluginRepositories>
>    <pluginRepository>
>      <id>maven2.myorg.org</id>
>      <url>http://myorg.org/maven2</url>
>    </pluginRepository>
>  </pluginRepositories>
>  <dependencies>
>    <dependency>
>      <groupId>jdbc</groupId>
>      <artifactId>oracle</artifactId>
>      <version>1.4</version>
>    </dependency>
>    <dependency>
>      <groupId>org.myorg</groupId>
>      <artifactId>some_service</artifactId>
>      <version>1.1</version>
>    </dependency>
>    <dependency>
>      <groupId>org.json</groupId>
>      <artifactId>json</artifactId>
>      <version>1.0</version>
>    </dependency>
>    <dependency>
>      <groupId>org.myorg</groupId>
>      <artifactId>utils</artifactId>
>      <version>1.2</version>
>    </dependency>
>    <dependency>
>      <groupId>log4j</groupId>
>      <artifactId>log4j</artifactId>
>      <version>1.2.15</version>
>      <scope>compile</scope>
>    </dependency>
>    <dependency>
>      <groupId>jdom</groupId>
>      <artifactId>jdom</artifactId>
>      <version>1.0</version>
>    </dependency>
>    <dependency>
>        <groupId>commons-httpclient</groupId>
>        <artifactId>commons-httpclient</artifactId>
>        <version>3.1</version>
>    </dependency>
>    <dependency>
>        <groupId>org.myorg</groupId>
>        <artifactId>some_java_service</artifactId>
>        <version>1.9</version>
>    </dependency>
>  </dependencies>
>  <distributionManagement>
>    <repository>
>        <id>org.myorg</id>
>      <url>scp://127.0.0.1/srv/www/htdocs/maven2</url>
>      <!--url>scp://myorg.org/srv/www/htdocs/maven2</url-->
>    </repository>
>    <site>
>        <id>myorg.org</id>
>      <url>scp://myorg.org/home/public_html/my-main-project</url>
>    </site>
>  </distributionManagement>
> </project>
>
>
>
> I would appreciate any advice you can give with this problem.
>
>
>
> Algie Morgan
> Senior Software Developer
> Integrated Ocean Drilling Program
> Texas  A & M University
>
>
> Algie E. Morgan
> Software Developer
> Department: Tools and Analytical Services (TAS)
>
>  morgan_a@iodp.tamu.edu
> Office: 979-845-1125
> Cell: 979-571-7973
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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