You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ha...@AFSCN.com on 2005/04/22 01:24:17 UTC

Can't project - what am I doing wrong?

This should be simple, but I can't figure out how the extend is failing.  I
have spent half he day trying to configure it like other working extended
example and it consistently has the IllegalStateException.  The illustration
below is what I believe the two project files should be, but I have tried
every combination I could think of of <artifactId>, <groupId> and <id>.
Please, someone please turn on the light bulb and show me the light! 

I have a simple base project file (jdimsBase.xml) which looks like the
following:

<project>
  <groupId>JDIMS</groupId>
  <organization>
    <name>AFSCN L3 Database Branch</name>
    <url>http://scn/</url>
    <logo>http://scnc/images/scnchome.gif</logo>
  </organization>
  .......... Developer and contributor XML blocks .......
  <build>  
    <nagEmailAddress>Harrison.Curtis@AFSCN.com</nagEmailAddress>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}/src</directory>
        <includes>
          <include>**/project.properties</include>
        </includes>
      </resource>
    </resources>
  </build>
  <dependencies>
    <dependency>
      <groupId>oracle</groupId>
      <jar>ojdbc14.jar</jar>
      <type>jar</type>
    </dependency>
  </dependencies>
</project>

One folder down in the Commons folder I have an extending project file
(project.xml):

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <extend>${basedir}/../jdimsBase.xml</extend>
  <pomVersion>3</pomVersion>
  <name>JDIMS Common Utilities</name>
  <artifactId>Common</artifactId>
  <currentVersion>2.0-SNAPSHOT</currentVersion>
  <package>com.afscn.common</package>
  <description>A collection of utilities supporting the JDIMS
application</description>
  <shortDescription>JDIMS Common</shortDescription>
  <inceptionYear>2000</inceptionYear>
  <reports>
  </reports>
</project>

When I try to run Maven against the Common project I get the following
error:

End event threw exception
java.lang.IllegalStateException: either id or (groupId and artifactId) must
be provided for a dependency
        at org.apache.maven.project.Dependency.getId(Dependency.java:116)
        at org.apache.maven.project.Dependency.toString(Dependency.java:313)

If I comment out the extend then Maven runs, but of couse it does nothing.
How should the <extend> be configured or is the problem something else?  The
only other issue that might be effecting the operation is the entire set of
folders are in a clearcase dynamic view.  I don't know if that could affect
Maven.
 
Bud Curtis
JDIMS Project
L-3 Communications
(719) 637-5633

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


Re: Can't project - what am I doing wrong?

Posted by Alonso Dominguez <al...@gmail.com>.
Harrison,

I think your problem is at the <dependency> section of your parent
file. You should try to use something like this:

<dependency>
  <groupId>oracle</groupId>
  <artifactId>ojdbc</artifactId>
  <version>14</version>
  <type>jar</type>
  <jar>ojdbc14.jar</jar>
</dependency>

I say this because Maven when looks for dependencies he expects to find them at:

[path/to/repository]/<groupId>/jars/<artifactId>-<version>.<type>

I think that if you miss the <artifactId> and <version> Maven results
in an exception, because of that, if you comment the <extend> Maven
doesn't knows anything about the dependency and runs succesfully.

Regards,
Alonso

On 4/22/05, Harrison.Curtis@afscn.com <Ha...@afscn.com> wrote:
> This should be simple, but I can't figure out how the extend is failing.  I
> have spent half he day trying to configure it like other working extended
> example and it consistently has the IllegalStateException.  The illustration
> below is what I believe the two project files should be, but I have tried
> every combination I could think of of <artifactId>, <groupId> and <id>.
> Please, someone please turn on the light bulb and show me the light!
> 
> I have a simple base project file (jdimsBase.xml) which looks like the
> following:
> 
> <project>
>   <groupId>JDIMS</groupId>
>   <organization>
>     <name>AFSCN L3 Database Branch</name>
>     <url>http://scn/</url>
>     <logo>http://scnc/images/scnchome.gif</logo>
>   </organization>
>   .......... Developer and contributor XML blocks .......
>   <build>
>     <nagEmailAddress>Harrison.Curtis@AFSCN.com</nagEmailAddress>
>     <sourceDirectory>${basedir}/src</sourceDirectory>
>     <resources>
>       <resource>
>         <directory>${basedir}/src</directory>
>         <includes>
>           <include>**/project.properties</include>
>         </includes>
>       </resource>
>     </resources>
>   </build>
>   <dependencies>
>     <dependency>
>       <groupId>oracle</groupId>
>       <jar>ojdbc14.jar</jar>
>       <type>jar</type>
>     </dependency>
>   </dependencies>
> </project>
> 
> One folder down in the Commons folder I have an extending project file
> (project.xml):
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
>   <extend>${basedir}/../jdimsBase.xml</extend>
>   <pomVersion>3</pomVersion>
>   <name>JDIMS Common Utilities</name>
>   <artifactId>Common</artifactId>
>   <currentVersion>2.0-SNAPSHOT</currentVersion>
>   <package>com.afscn.common</package>
>   <description>A collection of utilities supporting the JDIMS
> application</description>
>   <shortDescription>JDIMS Common</shortDescription>
>   <inceptionYear>2000</inceptionYear>
>   <reports>
>   </reports>
> </project>
> 
> When I try to run Maven against the Common project I get the following
> error:
> 
> End event threw exception
> java.lang.IllegalStateException: either id or (groupId and artifactId) must
> be provided for a dependency
>         at org.apache.maven.project.Dependency.getId(Dependency.java:116)
>         at org.apache.maven.project.Dependency.toString(Dependency.java:313)
> 
> If I comment out the extend then Maven runs, but of couse it does nothing.
> How should the <extend> be configured or is the problem something else?  The
> only other issue that might be effecting the operation is the entire set of
> folders are in a clearcase dynamic view.  I don't know if that could affect
> Maven.
> 
> Bud Curtis
> JDIMS Project
> L-3 Communications
> (719) 637-5633
> 
> ---------------------------------------------------------------------
> 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