You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steve Found <st...@volantis.com> on 2008/01/29 17:45:19 UTC

Conflicting Jar Names

Hi all,

I have two  separate systems that I build using maven.

One has groupId:com.volantis.synergetics artifactId:repository-api  
version:5.0-SNAPSHOT.  This system consists of around 50 artifacts.

The second has groupId:com.volantis.mcs  artifactId:repository-api  
version:5.0-SNAPSHOT. This system consists of around 150 artifacts.

When I come to build an installer, the jar files are all copied into a 
packaging directory, but as you can probably see, both jar files will be 
called repository-api-5.0-SNAPSHOT.jar. Consequently, the second jar 
will overwrite the first.

Now I could go and change all the artifactId's for this, but given that 
there are many more than just 2 systems in the project this would be 
very time consuming and prone to error.

What I want to do therefore is either :

1. Be able to set the name of the jar file when 'mvn install' installs 
the generated jar the repository so that the jar files do not conflict 
when the installer resolves it's dependancies. I tried setting the name 
of the generated jar from each subsystem pom, but this was lost when the 
jar was installed.

2. Be able to change the name of the jar when the dependancy is resolved 
but without adding each and every dependancy to the installer POM. For 
example... can I prepend volantis-synergetics- to every jar file that 
has a groupId of com.volantis.synergetics ? In the above example then I 
would get volantis-synergetics-repository-api.5.0-SNAPSHOT.jar and 
volantis-mcs-repository-api.5.0-SNAPSHOT.jar.

Is there any way I can achieve these things through the install or 
dependancy plugins ?

Regards,

   Steve.

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


Re: Conflicting Jar Names

Posted by Steve Found <st...@volantis.com>.
Thanks Lee... I had a feeling this would be the case :D  So I have 
witten myself a perl script to go around all the poms and change the 
artifactId's for all the dependancies.  The joy of legacy code :)


Lee Meador wrote:
> 1 isn't going to work because of how Maven finds files in the repo by 
> tracing down the file system path based on the group id and then going 
> down the path some more based on the artifact id and expecting the jar 
> file to have a matching name.
>
> The real solution is to change the artifactId, which you said would be 
> error prone. It sounds like what you have is error prone already since 
> your build process is having trouble telling jar files with the same 
> name apart.
>
> Sorry for no good news. Maybe someone else know more about it than i do.
>
> -- Lee
>
> On Jan 29, 2008 10:45 AM, Steve Found <stephen.found@volantis.com 
> <ma...@volantis.com>> wrote:
>
>     Hi all,
>
>     I have two  separate systems that I build using maven.
>
>     One has groupId:com.volantis.synergetics artifactId:repository-api
>     version:5.0-SNAPSHOT.  This system consists of around 50 artifacts.
>
>     The second has groupId:com.volantis.mcs  artifactId:repository-api
>     version:5.0-SNAPSHOT. This system consists of around 150 artifacts.
>
>     When I come to build an installer, the jar files are all copied into a
>     packaging directory, but as you can probably see, both jar files
>     will be
>     called repository-api-5.0-SNAPSHOT.jar. Consequently, the second jar
>     will overwrite the first.
>
>     Now I could go and change all the artifactId's for this, but given
>     that
>     there are many more than just 2 systems in the project this would be
>     very time consuming and prone to error.
>
>     What I want to do therefore is either :
>
>     1. Be able to set the name of the jar file when 'mvn install' installs
>     the generated jar the repository so that the jar files do not conflict
>     when the installer resolves it's dependancies. I tried setting the
>     name
>     of the generated jar from each subsystem pom, but this was lost
>     when the
>     jar was installed.
>
>     2. Be able to change the name of the jar when the dependancy is
>     resolved
>     but without adding each and every dependancy to the installer POM. For
>     example... can I prepend volantis-synergetics- to every jar file that
>     has a groupId of com.volantis.synergetics ? In the above example
>     then I
>     would get volantis-synergetics-repository-api.5.0-SNAPSHOT.jar and
>     volantis-mcs-repository-api.5.0-SNAPSHOT.jar.
>
>     Is there any way I can achieve these things through the install or
>     dependancy plugins ?
>
>     Regards,
>
>       Steve.
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>     <ma...@maven.apache.org>
>     For additional commands, e-mail: users-help@maven.apache.org
>     <ma...@maven.apache.org>
>
>
>
>
> -- 
> -- Lee Meador
> Sent from gmail. My real email address is lee AT leemeador.com 
> <http://leemeador.com> 


Re: Conflicting Jar Names

Posted by Steve Found <st...@volantis.com>.
Hi Jeff,

Thanks for this but it is something we already tried. Although that does 
change the name of the
generated jar file, the name is lost when it gets placed into the maven 
repository. When it gets installed,
the name reverts to ${artifactId}-${version}.jar in a directory mad from 
${groupId}. What I would need
is a <finalName> tag in the install plugin... and I could not see one.

Steve.

Jeff MAURY wrote:
> Steve,
>
> you can change the name of the JAR being generated through the finalName
> tag: it specifies the name of the file being generated. By default, it is
> equal to ${artifactId}-${version}.${packaging} so you may change it to:
> ${groupId}-${artifactId}-${version}.${packaging} for your purpose.
>
> Jeff
>
>
> On Jan 29, 2008 7:04 PM, Lee Meador <le...@leemeador.com> wrote:
>
>   
>> 1 isn't going to work because of how Maven finds files in the repo by
>> tracing down the file system path based on the group id and then going
>> down
>> the path some more based on the artifact id and expecting the jar file to
>> have a matching name.
>>
>> The real solution is to change the artifactId, which you said would be
>> error
>> prone. It sounds like what you have is error prone already since your
>> build
>> process is having trouble telling jar files with the same name apart.
>>
>> Sorry for no good news. Maybe someone else know more about it than i do.
>>
>> -- Lee
>>
>> On Jan 29, 2008 10:45 AM, Steve Found <st...@volantis.com> wrote:
>>
>>     
>>> Hi all,
>>>
>>> I have two  separate systems that I build using maven.
>>>
>>> One has groupId:com.volantis.synergetics artifactId:repository-api
>>> version:5.0-SNAPSHOT.  This system consists of around 50 artifacts.
>>>
>>> The second has groupId:com.volantis.mcs  artifactId:repository-api
>>> version:5.0-SNAPSHOT. This system consists of around 150 artifacts.
>>>
>>> When I come to build an installer, the jar files are all copied into a
>>> packaging directory, but as you can probably see, both jar files will be
>>> called repository-api-5.0-SNAPSHOT.jar. Consequently, the second jar
>>> will overwrite the first.
>>>
>>> Now I could go and change all the artifactId's for this, but given that
>>> there are many more than just 2 systems in the project this would be
>>> very time consuming and prone to error.
>>>
>>> What I want to do therefore is either :
>>>
>>> 1. Be able to set the name of the jar file when 'mvn install' installs
>>> the generated jar the repository so that the jar files do not conflict
>>> when the installer resolves it's dependancies. I tried setting the name
>>> of the generated jar from each subsystem pom, but this was lost when the
>>> jar was installed.
>>>
>>> 2. Be able to change the name of the jar when the dependancy is resolved
>>> but without adding each and every dependancy to the installer POM. For
>>> example... can I prepend volantis-synergetics- to every jar file that
>>> has a groupId of com.volantis.synergetics ? In the above example then I
>>> would get volantis-synergetics-repository-api.5.0-SNAPSHOT.jar and
>>> volantis-mcs-repository-api.5.0-SNAPSHOT.jar.
>>>
>>> Is there any way I can achieve these things through the install or
>>> dependancy plugins ?
>>>
>>> Regards,
>>>
>>>   Steve.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>       
>> --
>> -- Lee Meador
>> Sent from gmail. My real email address is lee AT leemeador.com
>>
>>     
>
>
>
>   


Re: Conflicting Jar Names

Posted by Jeff MAURY <je...@jeffmaury.com>.
Steve,

you can change the name of the JAR being generated through the finalName
tag: it specifies the name of the file being generated. By default, it is
equal to ${artifactId}-${version}.${packaging} so you may change it to:
${groupId}-${artifactId}-${version}.${packaging} for your purpose.

Jeff


On Jan 29, 2008 7:04 PM, Lee Meador <le...@leemeador.com> wrote:

> 1 isn't going to work because of how Maven finds files in the repo by
> tracing down the file system path based on the group id and then going
> down
> the path some more based on the artifact id and expecting the jar file to
> have a matching name.
>
> The real solution is to change the artifactId, which you said would be
> error
> prone. It sounds like what you have is error prone already since your
> build
> process is having trouble telling jar files with the same name apart.
>
> Sorry for no good news. Maybe someone else know more about it than i do.
>
> -- Lee
>
> On Jan 29, 2008 10:45 AM, Steve Found <st...@volantis.com> wrote:
>
> > Hi all,
> >
> > I have two  separate systems that I build using maven.
> >
> > One has groupId:com.volantis.synergetics artifactId:repository-api
> > version:5.0-SNAPSHOT.  This system consists of around 50 artifacts.
> >
> > The second has groupId:com.volantis.mcs  artifactId:repository-api
> > version:5.0-SNAPSHOT. This system consists of around 150 artifacts.
> >
> > When I come to build an installer, the jar files are all copied into a
> > packaging directory, but as you can probably see, both jar files will be
> > called repository-api-5.0-SNAPSHOT.jar. Consequently, the second jar
> > will overwrite the first.
> >
> > Now I could go and change all the artifactId's for this, but given that
> > there are many more than just 2 systems in the project this would be
> > very time consuming and prone to error.
> >
> > What I want to do therefore is either :
> >
> > 1. Be able to set the name of the jar file when 'mvn install' installs
> > the generated jar the repository so that the jar files do not conflict
> > when the installer resolves it's dependancies. I tried setting the name
> > of the generated jar from each subsystem pom, but this was lost when the
> > jar was installed.
> >
> > 2. Be able to change the name of the jar when the dependancy is resolved
> > but without adding each and every dependancy to the installer POM. For
> > example... can I prepend volantis-synergetics- to every jar file that
> > has a groupId of com.volantis.synergetics ? In the above example then I
> > would get volantis-synergetics-repository-api.5.0-SNAPSHOT.jar and
> > volantis-mcs-repository-api.5.0-SNAPSHOT.jar.
> >
> > Is there any way I can achieve these things through the install or
> > dependancy plugins ?
> >
> > Regards,
> >
> >   Steve.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee AT leemeador.com
>



-- 
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com

Re: Conflicting Jar Names

Posted by Lee Meador <le...@leemeador.com>.
1 isn't going to work because of how Maven finds files in the repo by
tracing down the file system path based on the group id and then going down
the path some more based on the artifact id and expecting the jar file to
have a matching name.

The real solution is to change the artifactId, which you said would be error
prone. It sounds like what you have is error prone already since your build
process is having trouble telling jar files with the same name apart.

Sorry for no good news. Maybe someone else know more about it than i do.

-- Lee

On Jan 29, 2008 10:45 AM, Steve Found <st...@volantis.com> wrote:

> Hi all,
>
> I have two  separate systems that I build using maven.
>
> One has groupId:com.volantis.synergetics artifactId:repository-api
> version:5.0-SNAPSHOT.  This system consists of around 50 artifacts.
>
> The second has groupId:com.volantis.mcs  artifactId:repository-api
> version:5.0-SNAPSHOT. This system consists of around 150 artifacts.
>
> When I come to build an installer, the jar files are all copied into a
> packaging directory, but as you can probably see, both jar files will be
> called repository-api-5.0-SNAPSHOT.jar. Consequently, the second jar
> will overwrite the first.
>
> Now I could go and change all the artifactId's for this, but given that
> there are many more than just 2 systems in the project this would be
> very time consuming and prone to error.
>
> What I want to do therefore is either :
>
> 1. Be able to set the name of the jar file when 'mvn install' installs
> the generated jar the repository so that the jar files do not conflict
> when the installer resolves it's dependancies. I tried setting the name
> of the generated jar from each subsystem pom, but this was lost when the
> jar was installed.
>
> 2. Be able to change the name of the jar when the dependancy is resolved
> but without adding each and every dependancy to the installer POM. For
> example... can I prepend volantis-synergetics- to every jar file that
> has a groupId of com.volantis.synergetics ? In the above example then I
> would get volantis-synergetics-repository-api.5.0-SNAPSHOT.jar and
> volantis-mcs-repository-api.5.0-SNAPSHOT.jar.
>
> Is there any way I can achieve these things through the install or
> dependancy plugins ?
>
> Regards,
>
>   Steve.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com