If it did that, it would be marvellous :)

Simon Kitching wrote:
This looks to me like a bug (or at least an oversight) in the dependency plugin. I 
presume this is what you are using to copy all the jars into a directory before building 
your "installer"?

Duplicate artifactIds are not normally a problem for maven; the classpath it 
builds for compiling, testing, etc will look like
  -classpath
    $M2REPO/group1/artifact1/artifact1-1.0.jar;
    $M2REPO/group2/artifact1/artifact1-1.0.jar
which is absolutely no problem.

The problem only comes when something like the dependency plugin tries to copy 
all the files into a single flat directory.

I think that the dependency plugin should check for duplicate artifactId values in the 
set of files it is extracting, and if one is found then use a "full" jarname, eg
  groupid-artifactid-version.jar
for the file it writes, instead of the "short" name.

However that's no use to you as a workaround :-(

Regards,
Simon

---- Jeff MAURY <[EMAIL PROTECTED]> schrieb:
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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
-- 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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to