You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Philipp Kraus <ph...@tu-clausthal.de> on 2015/03/01 12:41:12 UTC
write developers & contributors into Jar
Hello,
I use Maven 3.0 with the developers and contributors inside the pom.xml. I use also the manifestEntries with the maven-assembly-plugin to add some flags to the Jar manifest file.
I would like to add the developer and contributors list to the Jar, but I don’t know in which way I can add a list with name, email, and role types. My idea is that I create a comma separated list
list with the data, but how can I create within the pom.xml the correct output list? E.g. the pom.xml stores:
<developers>
<developer>
<id>myID</id>
<name>myName</id>
<email>myName@myDomain</email>
<roles>
<role>architect</role>
<role>developer</role>
</role>
</developer>
</developers>
so in the manifest should be a line e.g.
Developers = myName - myName@myDomain - architect / developer,
I have tried to define it with
<manifestEntries>
<Developers>${project.developers}</Developers>
</manifestEntries>
but this writes only the Java object items to the entry. How can I create a loop / xquery within the pom.xml to iterate over the developer items?
Thanks
Phil
Re: write developers & contributors into Jar
Posted by Baptiste Mathus <bm...@batmat.net>.
Actually, maven-archiver is a shared component, somehow low-level hence
used by many plugins.
In your case, just configure the maven-jar-plugin
http://maven.apache.org/plugins/maven-jar-plugin/examples/manifest-customization.html
Cheers
2015-03-01 20:21 GMT+01:00 Ron Wheeler <rw...@artifact-software.com>:
> http://maven.apache.org/shared/maven-archiver/index.html
> This plug-in seems to allow yo a way to add key/value pairs to the
> Manifest.
> manifestEntries A list of key/value pairs to add to the manifest.
>
>
>
>
> On 01/03/2015 6:41 AM, Philipp Kraus wrote:
>
>> Hello,
>>
>> I use Maven 3.0 with the developers and contributors inside the pom.xml.
>> I use also the manifestEntries with the maven-assembly-plugin to add some
>> flags to the Jar manifest file.
>> I would like to add the developer and contributors list to the Jar, but I
>> don’t know in which way I can add a list with name, email, and role types.
>> My idea is that I create a comma separated list
>> list with the data, but how can I create within the pom.xml the correct
>> output list? E.g. the pom.xml stores:
>>
>> <developers>
>> <developer>
>> <id>myID</id>
>> <name>myName</id>
>> <email>myName@myDomain</email>
>> <roles>
>> <role>architect</role>
>> <role>developer</role>
>> </role>
>> </developer>
>> </developers>
>>
>> so in the manifest should be a line e.g.
>>
>> Developers = myName - myName@myDomain - architect / developer,
>>
>> I have tried to define it with
>>
>> <manifestEntries>
>> <Developers>${project.developers}</Developers>
>> </manifestEntries>
>>
>> but this writes only the Java object items to the entry. How can I create
>> a loop / xquery within the pom.xml to iterate over the developer items?
>>
>> Thanks
>>
>> Phil
>>
>>
>>
>>
>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>
--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
Re: write developers & contributors into Jar
Posted by Ron Wheeler <rw...@artifact-software.com>.
http://maven.apache.org/shared/maven-archiver/index.html
This plug-in seems to allow yo a way to add key/value pairs to the Manifest.
manifestEntries A list of key/value pairs to add to the manifest.
On 01/03/2015 6:41 AM, Philipp Kraus wrote:
> Hello,
>
> I use Maven 3.0 with the developers and contributors inside the pom.xml. I use also the manifestEntries with the maven-assembly-plugin to add some flags to the Jar manifest file.
> I would like to add the developer and contributors list to the Jar, but I don’t know in which way I can add a list with name, email, and role types. My idea is that I create a comma separated list
> list with the data, but how can I create within the pom.xml the correct output list? E.g. the pom.xml stores:
>
> <developers>
> <developer>
> <id>myID</id>
> <name>myName</id>
> <email>myName@myDomain</email>
> <roles>
> <role>architect</role>
> <role>developer</role>
> </role>
> </developer>
> </developers>
>
> so in the manifest should be a line e.g.
>
> Developers = myName - myName@myDomain - architect / developer,
>
> I have tried to define it with
>
> <manifestEntries>
> <Developers>${project.developers}</Developers>
> </manifestEntries>
>
> but this writes only the Java object items to the entry. How can I create a loop / xquery within the pom.xml to iterate over the developer items?
>
> Thanks
>
> Phil
>
>
>
--
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102
Re: write developers & contributors into Jar
Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Phillipp,
> If you want to just have the information in the jar somewhere,
> the pom file will already be in the jar by default.
I second Manfred's suggestion, if using the POM works for your use case.
I'm sure other projects have invented their own version of this, but just
in case it's useful, here's some code to ease working with POMs:
https://github.com/scijava/scijava-common/blob/scijava-common-2.38.2/src/main/java/org/scijava/util/POM.java#L163-L170
You can easily obtain the POM associated with a given Class, and extract
whatever information you desire via XPath queries.
Regards,
Curtis
On Sun, Mar 1, 2015 at 10:25 PM, Manfred Moser <ma...@mosabuam.com> wrote:
> If you want to just have the information in the jar somewhere, the pom
> file will already be in the jar by default. This is due to the archiver
> config addMavenDescriptor set to true.
>
> See http://maven.apache.org/shared/maven-archiver/index.html for the
> location of the pom file and further archiver config details.
>
> manfred
>
> Philipp Kraus wrote on 01.03.2015 03:41:
>
> >
> > Hello,
> >
> > I use Maven 3.0 with the developers and contributors inside the pom.xml.
> I use
> > also the manifestEntries with the maven-assembly-plugin to add some
> flags to
> > the Jar manifest file.
> > I would like to add the developer and contributors list to the Jar, but I
> > don’t know in which way I can add a list with name, email, and role
> types. My
> > idea is that I create a comma separated list
> > list with the data, but how can I create within the pom.xml the correct
> output
> > list? E.g. the pom.xml stores:
> >
> > <developers>
> > <developer>
> > <id>myID</id>
> > <name>myName</id>
> > <email>myName@myDomain</email>
> > <roles>
> > <role>architect</role>
> > <role>developer</role>
> > </role>
> > </developer>
> > </developers>
> >
> > so in the manifest should be a line e.g.
> >
> > Developers = myName - myName@myDomain - architect / developer,
> >
> > I have tried to define it with
> >
> > <manifestEntries>
> > <Developers>${project.developers}</Developers>
> > </manifestEntries>
> >
> > but this writes only the Java object items to the entry. How can I
> create a
> > loop / xquery within the pom.xml to iterate over the developer items?
> >
> > Thanks
> >
> > Phil
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: write developers & contributors into Jar
Posted by Manfred Moser <ma...@mosabuam.com>.
If you want to just have the information in the jar somewhere, the pom file will already be in the jar by default. This is due to the archiver config addMavenDescriptor set to true.
See http://maven.apache.org/shared/maven-archiver/index.html for the location of the pom file and further archiver config details.
manfred
Philipp Kraus wrote on 01.03.2015 03:41:
>
> Hello,
>
> I use Maven 3.0 with the developers and contributors inside the pom.xml. I use
> also the manifestEntries with the maven-assembly-plugin to add some flags to
> the Jar manifest file.
> I would like to add the developer and contributors list to the Jar, but I
> don’t know in which way I can add a list with name, email, and role types. My
> idea is that I create a comma separated list
> list with the data, but how can I create within the pom.xml the correct output
> list? E.g. the pom.xml stores:
>
> <developers>
> <developer>
> <id>myID</id>
> <name>myName</id>
> <email>myName@myDomain</email>
> <roles>
> <role>architect</role>
> <role>developer</role>
> </role>
> </developer>
> </developers>
>
> so in the manifest should be a line e.g.
>
> Developers = myName - myName@myDomain - architect / developer,
>
> I have tried to define it with
>
> <manifestEntries>
> <Developers>${project.developers}</Developers>
> </manifestEntries>
>
> but this writes only the Java object items to the entry. How can I create a
> loop / xquery within the pom.xml to iterate over the developer items?
>
> Thanks
>
> Phil
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org