You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tim Kettler <ti...@udo.edu> on 2013/03/01 07:17:15 UTC
Re: Antwort: Re: Maven Shade Plugin
Am 28.02.2013 19:47, schrieb Joachim Durchholz:
> Am 28.02.2013 16:24, schrieb Jan Engler:
>> At first: in fact this is only one artifact. The full jar contains all
>> classes of the dependecies, the api a reduced set (using filtern in the
>> shade plugin).
>
> Is there a (conceivable) Maven build that uses api.jar as a dependency?
> Then it must be the main artifact at its GAV (groupId/artifact/version)
> coordinate.
>
> Is there a (conceivable) Maven build that uses full.jar as a dependency?
> Then it must be the main artifact at its GAV coordinate.
>
> If both jars need to be main artifacts, they need to go to different GAV
> coordinates. Because the dependent projects that need either api.jar or
> full.jar have no way of specifying which of them they actually need, the
> dependency section in their poms can only specify the GAV coordinate.
That's not correct. The classifier is part of the artifact coordinates
just like group, artifact(name) and version. A POM can just as well
depend on a secondary artifact:
<dependency>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0</version>
<classifier>api</classifier>
</dependency>
The complete coordinates of an artifact are GAVTC: group,
artifact(name), version, type (default is jar), classifier (default is
empty).
>> Even if I split that up into 2 projects, I cannot define modules then in
>> the pom, right?
>
> I'm not sure about that, I was never quite able to figure out what their
> purpose is.
>
> They might be just what you need to manage deployment of multiple
> related projects. But that's just a gut feeling I have; I'll leave the
> answer to that to the real experts.
>
> > I need to do s/t like that:
>> - Build up all modules (to be sure that everything is up to date)
>> - Build the shaded artifacts
>> - cross-compile them (using ikvm)
>> - put the artifact with some other stuff (doc, examples, dlls, etc).into
>> one zip (in fact three: windows, linux, mac)
>> - deploy all artifacts into nexus (or maybe somewhere else using wagon)
>
> Whoah. That ikvm and multi-arch stuff is way out of my league.
>
> ---------------------------------------------------------------------
> 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: Antwort: Re: Maven Shade Plugin
Posted by Stephen Connolly <st...@gmail.com>.
On 1 March 2013 15:03, Joachim Durchholz <jo...@durchholz.org> wrote:
> Am 01.03.2013 14:59, schrieb Stephen Connolly:
>
> On 1 March 2013 12:08, Joachim Durchholz <jo...@durchholz.org> wrote:
>>
>> Am 01.03.2013 07:17, schrieb Tim Kettler:
>>>
>>> That's not correct. The classifier is part of the artifact coordinates
>>>
>>>> just like group, artifact(name) and version.
>>>>
>>>>
>>> I knew. I just didn't want to contradict Stephen right away.
>>>
>>
>> The real issue is that the "classified" artifact will probably have
>> different transitive dependencies from the "primary", and hence the only
>> way to handle that is to use a separate module... plus I get tire of all
>> the 'splainin'
>>
>
> Let others do it then.
>
Sometimes I just need to respond ;-)
> Even better, improve the Maven docs.
It's on my TODO list (see the dev list)
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<us...@maven.apache.org>
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Antwort: Re: Maven Shade Plugin
Posted by Joachim Durchholz <jo...@durchholz.org>.
Am 01.03.2013 14:59, schrieb Stephen Connolly:
> On 1 March 2013 12:08, Joachim Durchholz <jo...@durchholz.org> wrote:
>
>> Am 01.03.2013 07:17, schrieb Tim Kettler:
>>
>> That's not correct. The classifier is part of the artifact coordinates
>>> just like group, artifact(name) and version.
>>>
>>
>> I knew. I just didn't want to contradict Stephen right away.
>
> The real issue is that the "classified" artifact will probably have
> different transitive dependencies from the "primary", and hence the only
> way to handle that is to use a separate module... plus I get tire of all
> the 'splainin'
Let others do it then.
Even better, improve the Maven docs.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Antwort: Re: Maven Shade Plugin
Posted by Stephen Connolly <st...@gmail.com>.
On 1 March 2013 12:08, Joachim Durchholz <jo...@durchholz.org> wrote:
> Am 01.03.2013 07:17, schrieb Tim Kettler:
>
> That's not correct. The classifier is part of the artifact coordinates
>> just like group, artifact(name) and version.
>>
>
> I knew. I just didn't want to contradict Stephen right away.
The real issue is that the "classified" artifact will probably have
different transitive dependencies from the "primary", and hence the only
way to handle that is to use a separate module... plus I get tire of all
the 'splainin'
> Plus, classifiers are usually assumed to identify auxiliary artifacts for
> a main artifact, and I suspect it's going to create lots of configuration
> overhead in some plugins.
> Jörg promptly pointed out a problem that doesn't even involve plugins.
>
>
> > A POM can just as well
>
>> depend on a secondary artifact:
>>
>> <dependency>
>> <groupId>foo</groupId>
>> <artifactId>bar</artifactId>
>> <version>1.0</version>
>> <classifier>api</classifier>
>> </dependency>
>>
> >
>
>> The complete coordinates of an artifact are GAVTC: group,
>> artifact(name), version, type (default is jar), classifier (default is
>> empty).
>>
>
> Hm. Can I specify the type in a dependency as well?
> Just curious, I certainly don't want to do that, but I might stumble over
> artifacts configured that way.
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<us...@maven.apache.org>
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Antwort: Re: Maven Shade Plugin
Posted by Jeffrey E Care <ca...@us.ibm.com>.
Joachim Durchholz <jo...@durchholz.org> wrote on 03/01/2013 07:08:52 AM:
> > The complete coordinates of an artifact are GAVTC: group,
> > artifact(name), version, type (default is jar), classifier (default is
> > empty).
>
> Hm. Can I specify the type in a dependency as well?
> Just curious, I certainly don't want to do that, but I might stumble
> over artifacts configured that way.
Yes, I do this quite often when I have projects that produce secondary
artifacts for use as WAR overlays.
--JEC
Re: Antwort: Re: Maven Shade Plugin
Posted by Joachim Durchholz <jo...@durchholz.org>.
Am 01.03.2013 07:17, schrieb Tim Kettler:
> That's not correct. The classifier is part of the artifact coordinates
> just like group, artifact(name) and version.
I knew. I just didn't want to contradict Stephen right away. Plus,
classifiers are usually assumed to identify auxiliary artifacts for a
main artifact, and I suspect it's going to create lots of configuration
overhead in some plugins.
Jörg promptly pointed out a problem that doesn't even involve plugins.
> A POM can just as well
> depend on a secondary artifact:
>
> <dependency>
> <groupId>foo</groupId>
> <artifactId>bar</artifactId>
> <version>1.0</version>
> <classifier>api</classifier>
> </dependency>
>
> The complete coordinates of an artifact are GAVTC: group,
> artifact(name), version, type (default is jar), classifier (default is
> empty).
Hm. Can I specify the type in a dependency as well?
Just curious, I certainly don't want to do that, but I might stumble
over artifacts configured that way.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Re: Re: Antwort: Re: Maven Shade Plugin
Posted by Wayne Fay <wa...@gmail.com>.
> Hmmm, I don't understand this. I will have an more or less empty jar in my
> nexus then, which is useless and there for no reason? For what reason does
> that file exists then?
Most like you are missing a configuration of the shade plugin:
shadedArtifactAttached boolean - Defines whether the shaded artifact
should be attached as classifier to the original artifact. If false,
the shaded jar will be the main artifact of the project
http://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html#shadedArtifactAttached
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Antwort: Re: Re: Antwort: Re: Maven Shade Plugin
Posted by Jan Engler <Ja...@sick.de>.
Hmmm, I don't understand this. I will have an more or less empty jar in my
nexus then, which is useless and there for no reason? For what reason does
that file exists then?
Jan
Mit freundlichen Grüßen / Best regards
Jan Engler
Central Research & Development
SICK AG
Erwin-Sick-Str. 1
79183 Waldkirch, Germany
Phone +49 7681 202-3214
mailto:jan.engler@sick.de
http://www.sick.com
Von: Wayne Fay <wa...@gmail.com>
An: Maven Users List <us...@maven.apache.org>
Datum: 01.03.2013 14:00
Betreff: Re: Re: Antwort: Re: Maven Shade Plugin
> working with a split-up build project seems to work. The only problem
that
> I face in the moment is that there is not only my 2 shaded jars (api and
> api-sources) but also a file called "original-api.jar". The content of
> this jar is only the meta-inf folder and I don't want this file to be
> placed in my nexus....Any hints?
Yes, put it in Nexus even though you "don't want to."
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
SICK AG - Sitz: Waldkirch i. Br. - Handelsregister: Freiburg i. Br. HRB
280355
Vorstand: Dr. Robert Bauer (Vorsitzender) - Reinhard Bösl - Dr. Martin
Krämer - Markus Paschmann - Markus Vatter
Aufsichtsrat: Gisela Sick (Ehrenvorsitzende) - Klaus M. Bukenberger
(Vorsitzender)
Re: Re: Antwort: Re: Maven Shade Plugin
Posted by Wayne Fay <wa...@gmail.com>.
> working with a split-up build project seems to work. The only problem that
> I face in the moment is that there is not only my 2 shaded jars (api and
> api-sources) but also a file called "original-api.jar". The content of
> this jar is only the meta-inf folder and I don't want this file to be
> placed in my nexus....Any hints?
Yes, put it in Nexus even though you "don't want to."
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Antwort: Re: Antwort: Re: Maven Shade Plugin
Posted by Jan Engler <Ja...@sick.de>.
Ok,
working with a split-up build project seems to work. The only problem that
I face in the moment is that there is not only my 2 shaded jars (api and
api-sources) but also a file called "original-api.jar". The content of
this jar is only the meta-inf folder and I don't want this file to be
placed in my nexus....Any hints?
Best,
Jan
Mit freundlichen Grüßen / Best regards
Jan Engler
Central Research & Development
SICK AG
Erwin-Sick-Str. 1
79183 Waldkirch, Germany
Phone +49 7681 202-3214
mailto:jan.engler@sick.de
http://www.sick.com
Von: Tim Kettler <ti...@udo.edu>
An: Maven Users List <us...@maven.apache.org>
Datum: 01.03.2013 09:49
Betreff: Re: Antwort: Re: Maven Shade Plugin
Am 01.03.2013 08:26, schrieb Jörg Schaible:
> Hi Tim,
>
> Tim Kettler wrote:
>
>> Am 28.02.2013 19:47, schrieb Joachim Durchholz:
>>> Am 28.02.2013 16:24, schrieb Jan Engler:
>>>> At first: in fact this is only one artifact. The full jar contains
all
>>>> classes of the dependecies, the api a reduced set (using filtern in
the
>>>> shade plugin).
>>>
>>> Is there a (conceivable) Maven build that uses api.jar as a
dependency?
>>> Then it must be the main artifact at its GAV
(groupId/artifact/version)
>>> coordinate.
>>>
>>> Is there a (conceivable) Maven build that uses full.jar as a
dependency?
>>> Then it must be the main artifact at its GAV coordinate.
>>>
>>> If both jars need to be main artifacts, they need to go to different
GAV
>>> coordinates. Because the dependent projects that need either api.jar
or
>>> full.jar have no way of specifying which of them they actually need,
the
>>> dependency section in their poms can only specify the GAV coordinate.
>>
>> That's not correct. The classifier is part of the artifact coordinates
>> just like group, artifact(name) and version. A POM can just as well
>> depend on a secondary artifact:
>>
>> <dependency>
>> <groupId>foo</groupId>
>> <artifactId>bar</artifactId>
>> <version>1.0</version>
>> <classifier>api</classifier>
>> </dependency>
>>
>> The complete coordinates of an artifact are GAVTC: group,
>> artifact(name), version, type (default is jar), classifier (default is
>> empty).
>
> That's not the real problem. What actually *is* a problem, if you depend
on
> different artifacts that bring both jars as transitive dependencies -
you
> cannot exclude e.g. the -api, because for exclusions you can only
specify
> GA. :-/
Ouch, never ran into this one.
> - Jörg
-Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
SICK AG - Sitz: Waldkirch i. Br. - Handelsregister: Freiburg i. Br. HRB
280355
Vorstand: Dr. Robert Bauer (Vorsitzender) - Reinhard Bösl - Dr. Martin
Krämer - Markus Paschmann - Markus Vatter
Aufsichtsrat: Gisela Sick (Ehrenvorsitzende) - Klaus M. Bukenberger
(Vorsitzender)
Re: Antwort: Re: Maven Shade Plugin
Posted by Tim Kettler <ti...@udo.edu>.
Am 01.03.2013 08:26, schrieb Jörg Schaible:
> Hi Tim,
>
> Tim Kettler wrote:
>
>> Am 28.02.2013 19:47, schrieb Joachim Durchholz:
>>> Am 28.02.2013 16:24, schrieb Jan Engler:
>>>> At first: in fact this is only one artifact. The full jar contains all
>>>> classes of the dependecies, the api a reduced set (using filtern in the
>>>> shade plugin).
>>>
>>> Is there a (conceivable) Maven build that uses api.jar as a dependency?
>>> Then it must be the main artifact at its GAV (groupId/artifact/version)
>>> coordinate.
>>>
>>> Is there a (conceivable) Maven build that uses full.jar as a dependency?
>>> Then it must be the main artifact at its GAV coordinate.
>>>
>>> If both jars need to be main artifacts, they need to go to different GAV
>>> coordinates. Because the dependent projects that need either api.jar or
>>> full.jar have no way of specifying which of them they actually need, the
>>> dependency section in their poms can only specify the GAV coordinate.
>>
>> That's not correct. The classifier is part of the artifact coordinates
>> just like group, artifact(name) and version. A POM can just as well
>> depend on a secondary artifact:
>>
>> <dependency>
>> <groupId>foo</groupId>
>> <artifactId>bar</artifactId>
>> <version>1.0</version>
>> <classifier>api</classifier>
>> </dependency>
>>
>> The complete coordinates of an artifact are GAVTC: group,
>> artifact(name), version, type (default is jar), classifier (default is
>> empty).
>
> That's not the real problem. What actually *is* a problem, if you depend on
> different artifacts that bring both jars as transitive dependencies - you
> cannot exclude e.g. the -api, because for exclusions you can only specify
> GA. :-/
Ouch, never ran into this one.
> - Jörg
-Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Antwort: Re: Antwort: Re: Maven Shade Plugin
Posted by Jan Engler <Ja...@sick.de>.
Hi,
To prevent any problems, I have now split up the build into two builds
(api-build and full-jar). I think I will introduce now a third project
(with pom packaging) that will build up all modules and collect the
artifacts that are needed. I hope that is a correct strategy to solve the
problem. I would like to reuse the api.jar and the full.jar as artifacts
that can be used as dependencies, therefore I take Jörg's comment into
account, thanks!
Best,
Jan
Mit freundlichen Grüßen / Best regards
Jan Engler
Central Research & Development
SICK AG
Erwin-Sick-Str. 1
79183 Waldkirch, Germany
Phone +49 7681 202-3214
mailto:jan.engler@sick.de
http://www.sick.com
Von: Jörg Schaible <Jo...@scalaris.com>
An: users@maven.apache.org
Datum: 01.03.2013 08:27
Betreff: Re: Antwort: Re: Maven Shade Plugin
Hi Tim,
Tim Kettler wrote:
> Am 28.02.2013 19:47, schrieb Joachim Durchholz:
>> Am 28.02.2013 16:24, schrieb Jan Engler:
>>> At first: in fact this is only one artifact. The full jar contains all
>>> classes of the dependecies, the api a reduced set (using filtern in
the
>>> shade plugin).
>>
>> Is there a (conceivable) Maven build that uses api.jar as a dependency?
>> Then it must be the main artifact at its GAV (groupId/artifact/version)
>> coordinate.
>>
>> Is there a (conceivable) Maven build that uses full.jar as a
dependency?
>> Then it must be the main artifact at its GAV coordinate.
>>
>> If both jars need to be main artifacts, they need to go to different
GAV
>> coordinates. Because the dependent projects that need either api.jar or
>> full.jar have no way of specifying which of them they actually need,
the
>> dependency section in their poms can only specify the GAV coordinate.
>
> That's not correct. The classifier is part of the artifact coordinates
> just like group, artifact(name) and version. A POM can just as well
> depend on a secondary artifact:
>
> <dependency>
> <groupId>foo</groupId>
> <artifactId>bar</artifactId>
> <version>1.0</version>
> <classifier>api</classifier>
> </dependency>
>
> The complete coordinates of an artifact are GAVTC: group,
> artifact(name), version, type (default is jar), classifier (default is
> empty).
That's not the real problem. What actually *is* a problem, if you depend
on
different artifacts that bring both jars as transitive dependencies - you
cannot exclude e.g. the -api, because for exclusions you can only specify
GA. :-/
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
SICK AG - Sitz: Waldkirch i. Br. - Handelsregister: Freiburg i. Br. HRB
280355
Vorstand: Dr. Robert Bauer (Vorsitzender) - Reinhard Bösl - Dr. Martin
Krämer - Markus Paschmann - Markus Vatter
Aufsichtsrat: Gisela Sick (Ehrenvorsitzende) - Klaus M. Bukenberger
(Vorsitzender)
Re: Antwort: Re: Maven Shade Plugin
Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Tim,
Tim Kettler wrote:
> Am 28.02.2013 19:47, schrieb Joachim Durchholz:
>> Am 28.02.2013 16:24, schrieb Jan Engler:
>>> At first: in fact this is only one artifact. The full jar contains all
>>> classes of the dependecies, the api a reduced set (using filtern in the
>>> shade plugin).
>>
>> Is there a (conceivable) Maven build that uses api.jar as a dependency?
>> Then it must be the main artifact at its GAV (groupId/artifact/version)
>> coordinate.
>>
>> Is there a (conceivable) Maven build that uses full.jar as a dependency?
>> Then it must be the main artifact at its GAV coordinate.
>>
>> If both jars need to be main artifacts, they need to go to different GAV
>> coordinates. Because the dependent projects that need either api.jar or
>> full.jar have no way of specifying which of them they actually need, the
>> dependency section in their poms can only specify the GAV coordinate.
>
> That's not correct. The classifier is part of the artifact coordinates
> just like group, artifact(name) and version. A POM can just as well
> depend on a secondary artifact:
>
> <dependency>
> <groupId>foo</groupId>
> <artifactId>bar</artifactId>
> <version>1.0</version>
> <classifier>api</classifier>
> </dependency>
>
> The complete coordinates of an artifact are GAVTC: group,
> artifact(name), version, type (default is jar), classifier (default is
> empty).
That's not the real problem. What actually *is* a problem, if you depend on
different artifacts that bring both jars as transitive dependencies - you
cannot exclude e.g. the -api, because for exclusions you can only specify
GA. :-/
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org