You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Peter Niederwieser <pn...@gmail.com> on 2012/02/09 15:38:14 UTC

Are profiles in published POMs a supported feature?

The published POM for
"com.sun.jersey.jersey-test-framework:jersey-test-framework-core:1.11" (1)
specifies additional dependencies in the "cobertura" and "default" profiles.
Are profiles in published POMs an officially supported feature, and are they
supposed to be resolved at consumption time? I wonder if that makes any
sense, and whether tools like Ivy and Gradle could even support this
(currently they don't).

Cheers,
Peter

--
Peter Niederwieser
Principal Engineer, Gradleware 
http://gradleware.com
Creator, Spock Framework 
http://spockframework.org
Twitter: @pniederw

(1)
http://search.maven.org/#artifactdetails%7Ccom.sun.jersey.jersey-test-framework%7Cjersey-test-framework-core%7C1.11%7Cjar

--
View this message in context: http://maven.40175.n5.nabble.com/Are-profiles-in-published-POMs-a-supported-feature-tp5469611p5469611.html
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: AW: Are profiles in published POMs a supported feature?

Posted by Peter Niederwieser <pn...@gmail.com>.
Christian Schlichtherle wrote
> 
> (1) Profiles are part of the POM reference specification.
> 

I think it's important to distinguish between the Maven build file and the
(tool independent?) module descriptor. As I see it, the POM reference
specification is about the former. I'm looking for a specification for the
latter so that we can make Gradle behave exactly like expected when dealing
with Maven modules and their dependencies. Does Maven offer a self-contained
library that generates a consumption-time view of the POM for the purpose of
dependency resolution?


Christian Schlichtherle wrote
> 
> (2) Every POM is published somehow - at least to your local repository.
> 

No doubt about that, but does this speak against resolving profiles at
publication time? I think there's already some POM transformation going on
at publication time. For example, variables might get replaced with their
values. I can't find any definitive information on this though.

Cheers,
Peter

--
Peter Niederwieser
Principal Engineer, Gradleware 
http://gradleware.com
Creator, Spock Framework 
http://spockframework.org
Twitter: @pniederw


--
View this message in context: http://maven.40175.n5.nabble.com/Are-profiles-in-published-POMs-a-supported-feature-tp5469611p5473432.html
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


AW: Are profiles in published POMs a supported feature?

Posted by Christian Schlichtherle <ch...@schlichtherle.de>.
Hi Peter,

here's another one:

        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>

Since this is provided by Sonatype, I suppose the answer is: Yes, it's
supposed to be a supported feature.

Of course, this was an empirical answer. The more theoretical answer is:

(1) Profiles are part of the POM reference specification.
(2) Every POM is published somehow - at least to your local repository.

So again, yes.

Regards,
Christian Schlichtherle



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


Re: Are profiles in published POMs a supported feature?

Posted by Ron Wheeler <rw...@artifact-software.com>.
Profiles appear to be like "good intentions". They pave the way to Hell.

There should be a warning in any discussion about profiles.
"Are really sure you want to do this? Is this really the right thing to 
do? Is there really no other way? Have you seriously considered sticking 
with Ant and forgetting that you ever heard of Maven?"


Ron

On 09/02/2012 9:53 AM, Stephen Connolly wrote:
> I should clarify,
>
> Profiles in published poms are "ok"
>
> Provided they do not affect in any way the dependency tree.
>
> If they affect the dependency tree (either directly by adding
> dependencies, or indirectly by modifying properties which affect the
> dependency tree) then they are evil.
>
> There may be some rare cases where indirect dependency tree
> modification is "ok" but I have yet to see one.
>
> -Stephen
>
> On 9 February 2012 14:50, Stephen Connolly
> <st...@gmail.com>  wrote:
>> They are the bastard son of satan.
>>
>> which is why adding dependencies via profiles is an anti-pattern
>>
>> people who do it give maven a bad name
>>
>> Take them out and shoot them.
>>
>> I may just have to thump psandoz on the shoulder really hard next time
>> I see him if old jersey poms did that kind of thing... I know he's not
>> at sun any more, which is why he won't get a shooting!
>>
>> On 9 February 2012 14:38, Peter Niederwieser<pn...@gmail.com>  wrote:
>>> The published POM for
>>> "com.sun.jersey.jersey-test-framework:jersey-test-framework-core:1.11" (1)
>>> specifies additional dependencies in the "cobertura" and "default" profiles.
>>> Are profiles in published POMs an officially supported feature, and are they
>>> supposed to be resolved at consumption time? I wonder if that makes any
>>> sense, and whether tools like Ivy and Gradle could even support this
>>> (currently they don't).
>>>
>>> Cheers,
>>> Peter
>>>
>>> --
>>> Peter Niederwieser
>>> Principal Engineer, Gradleware
>>> http://gradleware.com
>>> Creator, Spock Framework
>>> http://spockframework.org
>>> Twitter: @pniederw
>>>
>>> (1)
>>> http://search.maven.org/#artifactdetails%7Ccom.sun.jersey.jersey-test-framework%7Cjersey-test-framework-core%7C1.11%7Cjar
>>>
>>> --
>>> View this message in context: http://maven.40175.n5.nabble.com/Are-profiles-in-published-POMs-a-supported-feature-tp5469611p5469611.html
>>> 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
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: Are profiles in published POMs a supported feature?

Posted by Stephen Connolly <st...@gmail.com>.
I should clarify,

Profiles in published poms are "ok"

Provided they do not affect in any way the dependency tree.

If they affect the dependency tree (either directly by adding
dependencies, or indirectly by modifying properties which affect the
dependency tree) then they are evil.

There may be some rare cases where indirect dependency tree
modification is "ok" but I have yet to see one.

-Stephen

On 9 February 2012 14:50, Stephen Connolly
<st...@gmail.com> wrote:
> They are the bastard son of satan.
>
> which is why adding dependencies via profiles is an anti-pattern
>
> people who do it give maven a bad name
>
> Take them out and shoot them.
>
> I may just have to thump psandoz on the shoulder really hard next time
> I see him if old jersey poms did that kind of thing... I know he's not
> at sun any more, which is why he won't get a shooting!
>
> On 9 February 2012 14:38, Peter Niederwieser <pn...@gmail.com> wrote:
>> The published POM for
>> "com.sun.jersey.jersey-test-framework:jersey-test-framework-core:1.11" (1)
>> specifies additional dependencies in the "cobertura" and "default" profiles.
>> Are profiles in published POMs an officially supported feature, and are they
>> supposed to be resolved at consumption time? I wonder if that makes any
>> sense, and whether tools like Ivy and Gradle could even support this
>> (currently they don't).
>>
>> Cheers,
>> Peter
>>
>> --
>> Peter Niederwieser
>> Principal Engineer, Gradleware
>> http://gradleware.com
>> Creator, Spock Framework
>> http://spockframework.org
>> Twitter: @pniederw
>>
>> (1)
>> http://search.maven.org/#artifactdetails%7Ccom.sun.jersey.jersey-test-framework%7Cjersey-test-framework-core%7C1.11%7Cjar
>>
>> --
>> View this message in context: http://maven.40175.n5.nabble.com/Are-profiles-in-published-POMs-a-supported-feature-tp5469611p5469611.html
>> 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
>>

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


Re: Are profiles in published POMs a supported feature?

Posted by Stephen Connolly <st...@gmail.com>.
They are the bastard son of satan.

which is why adding dependencies via profiles is an anti-pattern

people who do it give maven a bad name

Take them out and shoot them.

I may just have to thump psandoz on the shoulder really hard next time
I see him if old jersey poms did that kind of thing... I know he's not
at sun any more, which is why he won't get a shooting!

On 9 February 2012 14:38, Peter Niederwieser <pn...@gmail.com> wrote:
> The published POM for
> "com.sun.jersey.jersey-test-framework:jersey-test-framework-core:1.11" (1)
> specifies additional dependencies in the "cobertura" and "default" profiles.
> Are profiles in published POMs an officially supported feature, and are they
> supposed to be resolved at consumption time? I wonder if that makes any
> sense, and whether tools like Ivy and Gradle could even support this
> (currently they don't).
>
> Cheers,
> Peter
>
> --
> Peter Niederwieser
> Principal Engineer, Gradleware
> http://gradleware.com
> Creator, Spock Framework
> http://spockframework.org
> Twitter: @pniederw
>
> (1)
> http://search.maven.org/#artifactdetails%7Ccom.sun.jersey.jersey-test-framework%7Cjersey-test-framework-core%7C1.11%7Cjar
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Are-profiles-in-published-POMs-a-supported-feature-tp5469611p5469611.html
> 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
>

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