You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by aldana <al...@gmx.de> on 2007/08/27 12:25:04 UTC

maven-jar-plugin: how to avoid conflicts in

hi,

maven amongst others is using groupId to avoid name clashes between
libraries (a:x.jar is different to b:x.jar).

now the problem arises when adding Classpath to MANIFEST.MF with following:

<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-jar-plugin</artifactId>
     <configuration>
       <archive>
        <manifest>
           <addClasspath>true</addClasspath>
           <classpathPrefix>lib</classpathPrefix>
         </manifest>
       </archive>
    </configuration>
</plugin> 			

with addClasspath in MANIFEST.MF it is unclear wheter to reference a:x.jar
or b:x.jar because there is only one jar listed -> Class-Path: lib/x.jar 

how is it possible to tell the MANIFEST.MF to include the groupId too?
Something like Class-Path: lib/a-x.jar lib/b-x.jar.

thanks in advance
-- 
View this message in context: http://www.nabble.com/maven-jar-plugin%3A-how-to-avoid-conflicts-in-%3CaddClasspath%3E-tf4334430s177.html#a12344543
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: maven-jar-plugin: how to avoid conflicts in

Posted by Geoffrey De Smet <ge...@gmail.com>.
Vote for http://jira.codehaus.org/browse/MJAR-82 :)

With kind regards,
Geoffrey De Smet

Tim Kettler schreef:
> This is currently not possible with the jar-plugin , but it sounds like 
> a useful feature. The assembly-plugin has an option for dependency-sets 
> called 'outputFileNameMapping' [1] where you can specify the format of 
> the filenames. Something similar would be useful for the format of the 
> classpath-entries in the jar manifest, too.
> 
> Going forward, I would post a feature request in jira [2].
> 
> You could even start looking into implementing this yourself and 
> contributing it back to the community. After all, it seems all the 
> pieces are there: The jar-plugin has the general infrastructure for 
> writing the dependencies to the classplath-entry and the assembly-plugin 
> has code for creating filenames using a given pattern. All that's needed 
> is to incorporate the code from the assembly-plugin in the jar plugin.
> 
> -Tim
> 
> [1] 
> http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet 
> 
> [2] http://jira.codehaus.org/browse/MJAR
> 
> aldana schrieb:
>> yes, for a workaround i did this too. but hoped there would be a tweak in
>> maven-jar-plugin, so artifactId could standalone because information of
>> a.b.c.d is already provided. this way i could avoid duplication.
>>
>>
>> Michael McCallum-3 wrote:
>>> i name my projects
>>>
>>> <groupId>a.b.c</groupId>
>>> <artifactId>a.b.c.d</artifactId>
>>>
>>> that way all the aggregations never have clashes... I only wish 
>>> library providers would to the same... it seems all the simple things 
>>> are
>>> overlooked
>>>
>>> On Monday 27 August 2007 22:25, aldana wrote:
>>>> hi,
>>>>
>>>> maven amongst others is using groupId to avoid name clashes between
>>>> libraries (a:x.jar is different to b:x.jar).
>>>>
>>>> now the problem arises when adding Classpath to MANIFEST.MF with
>>>> following:
>>>>
>>>> <plugin>
>>>>      <groupId>org.apache.maven.plugins</groupId>
>>>>      <artifactId>maven-jar-plugin</artifactId>
>>>>      <configuration>
>>>>        <archive>
>>>>         <manifest>
>>>>            <addClasspath>true</addClasspath>
>>>>            <classpathPrefix>lib</classpathPrefix>
>>>>          </manifest>
>>>>        </archive>
>>>>     </configuration>
>>>> </plugin>
>>>>
>>>> with addClasspath in MANIFEST.MF it is unclear wheter to reference
>>>> a:x.jar
>>>> or b:x.jar because there is only one jar listed -> Class-Path: 
>>>> lib/x.jar
>>>>
>>>> how is it possible to tell the MANIFEST.MF to include the groupId too?
>>>> Something like Class-Path: lib/a-x.jar lib/b-x.jar.
>>>>
>>>> thanks in advance
>>> -- 
>>> Michael McCallum
>>> Enterprise Engineer
>>> mailto:gholam@apache.org
>>>
>>> ---------------------------------------------------------------------
>>> 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: maven-jar-plugin: how to avoid conflicts in

Posted by aldana <al...@gmx.de>.
alright, sounds like a good idea. just wanted to ensure that it is not a
configuration error from my side.



Tim Kettler wrote:
> 
> This is currently not possible with the jar-plugin , but it sounds like 
> a useful feature. The assembly-plugin has an option for dependency-sets 
> called 'outputFileNameMapping' [1] where you can specify the format of 
> the filenames. Something similar would be useful for the format of the 
> classpath-entries in the jar manifest, too.
> 
> Going forward, I would post a feature request in jira [2].
> 
> You could even start looking into implementing this yourself and 
> contributing it back to the community. After all, it seems all the 
> pieces are there: The jar-plugin has the general infrastructure for 
> writing the dependencies to the classplath-entry and the assembly-plugin 
> has code for creating filenames using a given pattern. All that's needed 
> is to incorporate the code from the assembly-plugin in the jar plugin.
> 
> -Tim
> 
> [1] 
> http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet
> [2] http://jira.codehaus.org/browse/MJAR
> 
> aldana schrieb:
>> yes, for a workaround i did this too. but hoped there would be a tweak in
>> maven-jar-plugin, so artifactId could standalone because information of
>> a.b.c.d is already provided. this way i could avoid duplication.
>> 
>> 
>> Michael McCallum-3 wrote:
>>> i name my projects
>>>
>>> <groupId>a.b.c</groupId>
>>> <artifactId>a.b.c.d</artifactId>
>>>
>>> that way all the aggregations never have clashes... I only wish library 
>>> providers would to the same... it seems all the simple things are
>>> overlooked
>>>
>>> On Monday 27 August 2007 22:25, aldana wrote:
>>>> hi,
>>>>
>>>> maven amongst others is using groupId to avoid name clashes between
>>>> libraries (a:x.jar is different to b:x.jar).
>>>>
>>>> now the problem arises when adding Classpath to MANIFEST.MF with
>>>> following:
>>>>
>>>> <plugin>
>>>>      <groupId>org.apache.maven.plugins</groupId>
>>>>      <artifactId>maven-jar-plugin</artifactId>
>>>>      <configuration>
>>>>        <archive>
>>>>         <manifest>
>>>>            <addClasspath>true</addClasspath>
>>>>            <classpathPrefix>lib</classpathPrefix>
>>>>          </manifest>
>>>>        </archive>
>>>>     </configuration>
>>>> </plugin>
>>>>
>>>> with addClasspath in MANIFEST.MF it is unclear wheter to reference
>>>> a:x.jar
>>>> or b:x.jar because there is only one jar listed -> Class-Path:
>>>> lib/x.jar
>>>>
>>>> how is it possible to tell the MANIFEST.MF to include the groupId too?
>>>> Something like Class-Path: lib/a-x.jar lib/b-x.jar.
>>>>
>>>> thanks in advance
>>> -- 
>>> Michael McCallum
>>> Enterprise Engineer
>>> mailto:gholam@apache.org
>>>
>>> ---------------------------------------------------------------------
>>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/maven-jar-plugin%3A-how-to-avoid-conflicts-in-%3CaddClasspath%3E-tf4334430s177.html#a12345658
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: maven-jar-plugin: how to avoid conflicts in

Posted by Tim Kettler <ti...@udo.edu>.
This is currently not possible with the jar-plugin , but it sounds like 
a useful feature. The assembly-plugin has an option for dependency-sets 
called 'outputFileNameMapping' [1] where you can specify the format of 
the filenames. Something similar would be useful for the format of the 
classpath-entries in the jar manifest, too.

Going forward, I would post a feature request in jira [2].

You could even start looking into implementing this yourself and 
contributing it back to the community. After all, it seems all the 
pieces are there: The jar-plugin has the general infrastructure for 
writing the dependencies to the classplath-entry and the assembly-plugin 
has code for creating filenames using a given pattern. All that's needed 
is to incorporate the code from the assembly-plugin in the jar plugin.

-Tim

[1] 
http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet
[2] http://jira.codehaus.org/browse/MJAR

aldana schrieb:
> yes, for a workaround i did this too. but hoped there would be a tweak in
> maven-jar-plugin, so artifactId could standalone because information of
> a.b.c.d is already provided. this way i could avoid duplication.
> 
> 
> Michael McCallum-3 wrote:
>> i name my projects
>>
>> <groupId>a.b.c</groupId>
>> <artifactId>a.b.c.d</artifactId>
>>
>> that way all the aggregations never have clashes... I only wish library 
>> providers would to the same... it seems all the simple things are
>> overlooked
>>
>> On Monday 27 August 2007 22:25, aldana wrote:
>>> hi,
>>>
>>> maven amongst others is using groupId to avoid name clashes between
>>> libraries (a:x.jar is different to b:x.jar).
>>>
>>> now the problem arises when adding Classpath to MANIFEST.MF with
>>> following:
>>>
>>> <plugin>
>>>      <groupId>org.apache.maven.plugins</groupId>
>>>      <artifactId>maven-jar-plugin</artifactId>
>>>      <configuration>
>>>        <archive>
>>>         <manifest>
>>>            <addClasspath>true</addClasspath>
>>>            <classpathPrefix>lib</classpathPrefix>
>>>          </manifest>
>>>        </archive>
>>>     </configuration>
>>> </plugin>
>>>
>>> with addClasspath in MANIFEST.MF it is unclear wheter to reference
>>> a:x.jar
>>> or b:x.jar because there is only one jar listed -> Class-Path: lib/x.jar
>>>
>>> how is it possible to tell the MANIFEST.MF to include the groupId too?
>>> Something like Class-Path: lib/a-x.jar lib/b-x.jar.
>>>
>>> thanks in advance
>> -- 
>> Michael McCallum
>> Enterprise Engineer
>> mailto:gholam@apache.org
>>
>> ---------------------------------------------------------------------
>> 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: maven-jar-plugin: how to avoid conflicts in

Posted by aldana <al...@gmx.de>.
yes, for a workaround i did this too. but hoped there would be a tweak in
maven-jar-plugin, so artifactId could standalone because information of
a.b.c.d is already provided. this way i could avoid duplication.


Michael McCallum-3 wrote:
> 
> i name my projects
> 
> <groupId>a.b.c</groupId>
> <artifactId>a.b.c.d</artifactId>
> 
> that way all the aggregations never have clashes... I only wish library 
> providers would to the same... it seems all the simple things are
> overlooked
> 
> On Monday 27 August 2007 22:25, aldana wrote:
>> hi,
>>
>> maven amongst others is using groupId to avoid name clashes between
>> libraries (a:x.jar is different to b:x.jar).
>>
>> now the problem arises when adding Classpath to MANIFEST.MF with
>> following:
>>
>> <plugin>
>>      <groupId>org.apache.maven.plugins</groupId>
>>      <artifactId>maven-jar-plugin</artifactId>
>>      <configuration>
>>        <archive>
>>         <manifest>
>>            <addClasspath>true</addClasspath>
>>            <classpathPrefix>lib</classpathPrefix>
>>          </manifest>
>>        </archive>
>>     </configuration>
>> </plugin>
>>
>> with addClasspath in MANIFEST.MF it is unclear wheter to reference
>> a:x.jar
>> or b:x.jar because there is only one jar listed -> Class-Path: lib/x.jar
>>
>> how is it possible to tell the MANIFEST.MF to include the groupId too?
>> Something like Class-Path: lib/a-x.jar lib/b-x.jar.
>>
>> thanks in advance
> 
> -- 
> Michael McCallum
> Enterprise Engineer
> mailto:gholam@apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/maven-jar-plugin%3A-how-to-avoid-conflicts-in-%3CaddClasspath%3E-tf4334430s177.html#a12344732
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: maven-jar-plugin: how to avoid conflicts in

Posted by Michael McCallum <gh...@apache.org>.
i name my projects

<groupId>a.b.c</groupId>
<artifactId>a.b.c.d</artifactId>

that way all the aggregations never have clashes... I only wish library 
providers would to the same... it seems all the simple things are overlooked

On Monday 27 August 2007 22:25, aldana wrote:
> hi,
>
> maven amongst others is using groupId to avoid name clashes between
> libraries (a:x.jar is different to b:x.jar).
>
> now the problem arises when adding Classpath to MANIFEST.MF with following:
>
> <plugin>
>      <groupId>org.apache.maven.plugins</groupId>
>      <artifactId>maven-jar-plugin</artifactId>
>      <configuration>
>        <archive>
>         <manifest>
>            <addClasspath>true</addClasspath>
>            <classpathPrefix>lib</classpathPrefix>
>          </manifest>
>        </archive>
>     </configuration>
> </plugin>
>
> with addClasspath in MANIFEST.MF it is unclear wheter to reference a:x.jar
> or b:x.jar because there is only one jar listed -> Class-Path: lib/x.jar
>
> how is it possible to tell the MANIFEST.MF to include the groupId too?
> Something like Class-Path: lib/a-x.jar lib/b-x.jar.
>
> thanks in advance

-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

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