You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by huser <mp...@atxg.com> on 2009/03/25 19:51:59 UTC

Duplicate name in parent and current

Hi,

I have a situation in which the dir names are same. 

Example:
/base
/base/modA
/base/modA/modA

I get the following error while trying to run mvn compile. The code for 2
POM's is below. What should I change in the parent to make this work ?

Thanks,


Reason: Parent element is a duplicate of the current project  for project
com.co.t3:modA


[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Parent element is a
duplicate
of the current project  for project com.co.t3:modA
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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)

/base/modA/pom.xml
	<parent>
		<groupId>com.co.t3</groupId>
		<artifactId>t3</artifactId>
		<version>1.0-SNAPSHOT</version>
		<relativePath>../base/pom.xml</relativePath>
	</parent>

	<name> modA </name>
  <groupId>com.co.t3</groupId>

  <artifactId>modA</artifactId>

  <packaging>pom</packaging>

  <version>1.0-SNAPSHOT</version>

/base/modA/modA/pom.xml
  	<parent>
		<groupId>com.co.t3</groupId>
		<artifactId>modA</artifactId>
		<version>1.0-SNAPSHOT</version>
	</parent>
  <groupId>com.co.t3</groupId>

  <artifactId>modA</artifactId>

  <packaging>jar</packaging>

  <version>1.0-SNAPSHOT</version>

-- 
View this message in context: http://www.nabble.com/Duplicate-name-in-parent-and-current-tp22707830p22707830.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Duplicate name in parent and current

Posted by Stephen Connolly <st...@gmail.com>.
only because the group ids are the same

2009/3/25 Paul Gier <pg...@redhat.com>

> I think it's the duplicated artifactId's that is causing the problem.
>  Maybe the artifactId of the pom in the subdirectory modA/modA should be set
> to "modA-modA" or something like that.
>
>
> huser wrote:
>
>> Hi,
>>
>> I have a situation in which the dir names are same.
>> Example:
>> /base
>> /base/modA
>> /base/modA/modA
>>
>> I get the following error while trying to run mvn compile. The code for 2
>> POM's is below. What should I change in the parent to make this work ?
>>
>> Thanks,
>>
>>
>> Reason: Parent element is a duplicate of the current project  for project
>> com.co.t3:modA
>>
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.reactor.MavenExecutionException: Parent element is a
>> duplicate
>> of the current project  for project com.co.t3:modA
>>        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
>>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
>>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>        at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        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)
>>
>> /base/modA/pom.xml
>>        <parent>
>>                <groupId>com.co.t3</groupId>
>>                <artifactId>t3</artifactId>
>>                <version>1.0-SNAPSHOT</version>
>>                <relativePath>../base/pom.xml</relativePath>
>>        </parent>
>>
>>        <name> modA </name>
>>  <groupId>com.co.t3</groupId>
>>
>>  <artifactId>modA</artifactId>
>>
>>  <packaging>pom</packaging>
>>
>>  <version>1.0-SNAPSHOT</version>
>>
>> /base/modA/modA/pom.xml
>>        <parent>
>>                <groupId>com.co.t3</groupId>
>>                <artifactId>modA</artifactId>
>>                <version>1.0-SNAPSHOT</version>
>>        </parent>
>>  <groupId>com.co.t3</groupId>
>>
>>  <artifactId>modA</artifactId>
>>
>>  <packaging>jar</packaging>
>>
>>  <version>1.0-SNAPSHOT</version>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Duplicate name in parent and current

Posted by Paul Gier <pg...@redhat.com>.
I think it's the duplicated artifactId's that is causing the problem.  Maybe the 
artifactId of the pom in the subdirectory modA/modA should be set to "modA-modA" 
or something like that.

huser wrote:
> Hi,
> 
> I have a situation in which the dir names are same. 
> 
> Example:
> /base
> /base/modA
> /base/modA/modA
> 
> I get the following error while trying to run mvn compile. The code for 2
> POM's is below. What should I change in the parent to make this work ?
> 
> Thanks,
> 
> 
> Reason: Parent element is a duplicate of the current project  for project
> com.co.t3:modA
> 
> 
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.reactor.MavenExecutionException: Parent element is a
> duplicate
> of the current project  for project com.co.t3:modA
>         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         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)
> 
> /base/modA/pom.xml
> 	<parent>
> 		<groupId>com.co.t3</groupId>
> 		<artifactId>t3</artifactId>
> 		<version>1.0-SNAPSHOT</version>
> 		<relativePath>../base/pom.xml</relativePath>
> 	</parent>
> 
> 	<name> modA </name>
>   <groupId>com.co.t3</groupId>
> 
>   <artifactId>modA</artifactId>
> 
>   <packaging>pom</packaging>
> 
>   <version>1.0-SNAPSHOT</version>
> 
> /base/modA/modA/pom.xml
>   	<parent>
> 		<groupId>com.co.t3</groupId>
> 		<artifactId>modA</artifactId>
> 		<version>1.0-SNAPSHOT</version>
> 	</parent>
>   <groupId>com.co.t3</groupId>
> 
>   <artifactId>modA</artifactId>
> 
>   <packaging>jar</packaging>
> 
>   <version>1.0-SNAPSHOT</version>
> 


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


Re: Duplicate name in parent and current

Posted by Stephen Connolly <st...@gmail.com>.
You cannot have two modules in the reactor with the same groupId and
artifactId...

from your pom snippets it looks like this is the case...

consider changing either the groupId or the artifactId of one of the modA's

(Note that the artifactId does not have to be the same as the directory
name... it's just that it's nicer if it is ;-) )

-Stephen

2009/3/25 huser <mp...@atxg.com>

>
> Hi,
>
> I have a situation in which the dir names are same.
>
> Example:
> /base
> /base/modA
> /base/modA/modA
>
> I get the following error while trying to run mvn compile. The code for 2
> POM's is below. What should I change in the parent to make this work ?
>
> Thanks,
>
>
> Reason: Parent element is a duplicate of the current project  for project
> com.co.t3:modA
>
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.reactor.MavenExecutionException: Parent element is a
> duplicate
> of the current project  for project com.co.t3:modA
>        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        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)
>
> /base/modA/pom.xml
>        <parent>
>                <groupId>com.co.t3</groupId>
>                <artifactId>t3</artifactId>
>                <version>1.0-SNAPSHOT</version>
>                <relativePath>../base/pom.xml</relativePath>
>        </parent>
>
>        <name> modA </name>
>  <groupId>com.co.t3</groupId>
>
>  <artifactId>modA</artifactId>
>
>  <packaging>pom</packaging>
>
>  <version>1.0-SNAPSHOT</version>
>
> /base/modA/modA/pom.xml
>        <parent>
>                <groupId>com.co.t3</groupId>
>                <artifactId>modA</artifactId>
>                <version>1.0-SNAPSHOT</version>
>        </parent>
>  <groupId>com.co.t3</groupId>
>
>  <artifactId>modA</artifactId>
>
>  <packaging>jar</packaging>
>
>  <version>1.0-SNAPSHOT</version>
>
> --
> View this message in context:
> http://www.nabble.com/Duplicate-name-in-parent-and-current-tp22707830p22707830.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>