plugin version ranges errors with Maven 3.1.1

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

plugin version ranges errors with Maven 3.1.1

John Dix
I am trying to specify a version range in a pom.xml in order to support our build by doing the following:

<plugin>
<groupId> org.apache.maven.plugins</groupId>
<artifactId> maven-shade-plugin</artifactId>
<version>[2.0, )</version>
</plugin>

And I am getting this error:

[ERROR] Plugin org.apache.maven.plugins:maven-shade-plugin:[2.0,) or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-shade-plugin:jar:[2.0,): Could not transfer artifact org.apache.maven.plugins:maven-shade-plugin:pom:[2.0,) from/to qpass-nexus-hosted-releases (http://xxxx:8081/nexus/content/repositories/releases): Illegal character in path at index 115: http://xxx:8081/nexus/content/repositories/releases/org/apache/maven/plugins/maven-shade-plugin/[2.0,)/maven-shade-plugin-[2.0,).pom -> [Help 1]

According to the examples and documentation I have seen, this should work.

Any idea?


John "Caolan" Dix
Programming Sr. SME, Digital Commerce
Amdocs Mobile Financial Services Division
o: 206-288-0308 m: 425.351.7340
AMDOCS | EMBRACE CHALLENGE EXPERIENCE SUCCESS

Did you know...?
A global consumer survey by Analysys Mason and Amdocs reveals that cash is past its prime. Download the new white paper, "Mobile Financial Services: The Evolution of Payment" here<http://amdocs.com/mfs-wp>.

Read the latest on Amdocs.com<http://www.amdocs.com/> and the Amdocs blog network<http://blogs.amdocs.com/> - and follow us on Facebook<https://www.facebook.com/AmdocsMobilePayments>, Twitter<https://twitter.com/amdocsmpayments>, LinkedIn<http://www.linkedin.com/company/amdocs>, YouTube<http://www.youtube.com/amdocs> and Google+<https://plus.google.com/+amdocs#+amdocs/posts>


This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp
Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Wayne Fay
> I am trying to specify a version range in a pom.xml in order to support our build by doing the following:

The idea of supporting version ranges in plugins was good when first
implemented but the community has largely decided it is actually not a
best practice as it can introduce instability in an otherwise stable
build. I would just drop it and use a fixed version until you realize
that you need features in a newer release of the plugin.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: plugin version ranges errors with Maven 3.1.1

John Dix
Agreed however I need to support two builds in our environment one that uses Maven 3.0.5 and one that does 3.1.1 without having to change the file every time.

Do you know what is wrong with the version range?

-----Original Message-----
From: Wayne Fay [mailto:[hidden email]]
Sent: Friday, December 06, 2013 12:08 PM
To: Maven Users List
Subject: Re: plugin version ranges errors with Maven 3.1.1

> I am trying to specify a version range in a pom.xml in order to support our build by doing the following:

The idea of supporting version ranges in plugins was good when first implemented but the community has largely decided it is actually not a best practice as it can introduce instability in an otherwise stable build. I would just drop it and use a fixed version until you realize that you need features in a newer release of the plugin.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Ron Wheeler
In reply to this post by John Dix
Version ranges are generally a bad idea.

What is the point of allowing an older version of shade? Are there bugs
that have been fixed in newer version that you depend on? But then why
would you want Maven to pick a newer one.

Why not pick one that works with your version of Maven and stick with it?

You can also omit the version and let Maven pick one but this is not
recommended.

We specify a version in the dependencyManagement section of the parent
and are sure that every build uses the right version.

http://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency 
is a nice discussion of version ranges.
It shows that your syntax should work.
It appears that maven is having trouble recognizing the "[" as the start
of a version. Is it possible that there is a character (space or
non-printing) before the "[".

Ron

On 06/12/2013 2:12 PM, John Dix wrote:

> I am trying to specify a version range in a pom.xml in order to support our build by doing the following:
>
> <plugin>
> <groupId> org.apache.maven.plugins</groupId>
> <artifactId> maven-shade-plugin</artifactId>
> <version>[2.0, )</version>
> </plugin>
>
> And I am getting this error:
>
> [ERROR] Plugin org.apache.maven.plugins:maven-shade-plugin:[2.0,) or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-shade-plugin:jar:[2.0,): Could not transfer artifact org.apache.maven.plugins:maven-shade-plugin:pom:[2.0,) from/to qpass-nexus-hosted-releases (http://xxxx:8081/nexus/content/repositories/releases): Illegal character in path at index 115: http://xxx:8081/nexus/content/repositories/releases/org/apache/maven/plugins/maven-shade-plugin/[2.0,)/maven-shade-plugin-[2.0,).pom -> [Help 1]
>
> According to the examples and documentation I have seen, this should work.
>
> Any idea?
>
>
> John "Caolan" Dix
> Programming Sr. SME, Digital Commerce
> Amdocs Mobile Financial Services Division
> o: 206-288-0308 m: 425.351.7340
> AMDOCS | EMBRACE CHALLENGE EXPERIENCE SUCCESS
>
> Did you know...?
> A global consumer survey by Analysys Mason and Amdocs reveals that cash is past its prime. Download the new white paper, "Mobile Financial Services: The Evolution of Payment" here<http://amdocs.com/mfs-wp>.
>
> Read the latest on Amdocs.com<http://www.amdocs.com/> and the Amdocs blog network<http://blogs.amdocs.com/> - and follow us on Facebook<https://www.facebook.com/AmdocsMobilePayments>, Twitter<https://twitter.com/amdocsmpayments>, LinkedIn<http://www.linkedin.com/company/amdocs>, YouTube<http://www.youtube.com/amdocs> and Google+<https://plus.google.com/+amdocs#+amdocs/posts>
>
>
> This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Wayne Fay
In reply to this post by John Dix
> Agreed however I need to support two builds in our environment one that uses
> Maven 3.0.5 and one that does 3.1.1 without having to change the file every time.

Sorry for asking the obvious question, but what prevents you from
specifying version [2.0] or whatever and using that with both 3.0.5
and 3.1.1? Is there some incompatibility I am unaware of presently?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Ron Wheeler
In reply to this post by John Dix
Pick a shade version that works on both.

Ron

On 06/12/2013 3:14 PM, John Dix wrote:

> Agreed however I need to support two builds in our environment one that uses Maven 3.0.5 and one that does 3.1.1 without having to change the file every time.
>
> Do you know what is wrong with the version range?
>
> -----Original Message-----
> From: Wayne Fay [mailto:[hidden email]]
> Sent: Friday, December 06, 2013 12:08 PM
> To: Maven Users List
> Subject: Re: plugin version ranges errors with Maven 3.1.1
>
>> I am trying to specify a version range in a pom.xml in order to support our build by doing the following:
> The idea of supporting version ranges in plugins was good when first implemented but the community has largely decided it is actually not a best practice as it can introduce instability in an otherwise stable build. I would just drop it and use a fixed version until you realize that you need features in a newer release of the plugin.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Curtis Rueden
In reply to this post by John Dix
Hi John,

> According to the examples and documentation I have seen, this should
> work.

At least in my quickly Googling around, I cannot find anything that says
that version ranges actually work for plugins -- only for dependencies. Do
you have a pointer to docs explicitly stating that it works with Maven
plugins? If not, it might not be supported at all. I did a quick test on my
system with Maven 3.1.1 and got the same error you did.

Regards,
Curtis


On Fri, Dec 6, 2013 at 1:12 PM, John Dix <[hidden email]> wrote:

> I am trying to specify a version range in a pom.xml in order to support
> our build by doing the following:
>
> <plugin>
> <groupId> org.apache.maven.plugins</groupId>
> <artifactId> maven-shade-plugin</artifactId>
> <version>[2.0, )</version>
> </plugin>
>
> And I am getting this error:
>
> [ERROR] Plugin org.apache.maven.plugins:maven-shade-plugin:[2.0,) or one
> of its dependencies could not be resolved: Failed to read artifact
> descriptor for org.apache.maven.plugins:maven-shade-plugin:jar:[2.0,):
> Could not transfer artifact
> org.apache.maven.plugins:maven-shade-plugin:pom:[2.0,) from/to
> qpass-nexus-hosted-releases (
> http://xxxx:8081/nexus/content/repositories/releases): Illegal character
> in path at index 115:
> http://xxx:8081/nexus/content/repositories/releases/org/apache/maven/plugins/maven-shade-plugin/[2.0,)/maven-shade-plugin-[2.0,).pom-> [Help 1]
>
> According to the examples and documentation I have seen, this should work.
>
> Any idea?
>
>
> John "Caolan" Dix
> Programming Sr. SME, Digital Commerce
> Amdocs Mobile Financial Services Division
> o: 206-288-0308 m: 425.351.7340
> AMDOCS | EMBRACE CHALLENGE EXPERIENCE SUCCESS
>
> Did you know...?
> A global consumer survey by Analysys Mason and Amdocs reveals that cash is
> past its prime. Download the new white paper, "Mobile Financial Services:
> The Evolution of Payment" here<http://amdocs.com/mfs-wp>.
>
> Read the latest on Amdocs.com<http://www.amdocs.com/> and the Amdocs blog
> network<http://blogs.amdocs.com/> - and follow us on Facebook<
> https://www.facebook.com/AmdocsMobilePayments>, Twitter<
> https://twitter.com/amdocsmpayments>, LinkedIn<
> http://www.linkedin.com/company/amdocs>, YouTube<
> http://www.youtube.com/amdocs> and Google+<
> https://plus.google.com/+amdocs#+amdocs/posts>
>
>
> This message and the information contained herein is proprietary and
> confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>
Reply | Threaded
Open this post in threaded view
|

RE: plugin version ranges errors with Maven 3.1.1

John Dix
Ahhhhhhh, so the version contraints actually depend upon what kind of component you're specifying... I guess that makes sense as it helps determine how Maven itself works... Which also explains why the other gentlemen said that it breaks best practices...

Makes sense then.

Thanks!

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Curtis Rueden
Sent: Friday, December 06, 2013 1:12 PM
To: Maven Users List
Subject: Re: plugin version ranges errors with Maven 3.1.1

Hi John,

> According to the examples and documentation I have seen, this should
> work.

At least in my quickly Googling around, I cannot find anything that says that version ranges actually work for plugins -- only for dependencies. Do you have a pointer to docs explicitly stating that it works with Maven plugins? If not, it might not be supported at all. I did a quick test on my system with Maven 3.1.1 and got the same error you did.

Regards,
Curtis


On Fri, Dec 6, 2013 at 1:12 PM, John Dix <[hidden email]> wrote:

> I am trying to specify a version range in a pom.xml in order to
> support our build by doing the following:
>
> <plugin>
> <groupId> org.apache.maven.plugins</groupId>
> <artifactId> maven-shade-plugin</artifactId> <version>[2.0,
> )</version> </plugin>
>
> And I am getting this error:
>
> [ERROR] Plugin org.apache.maven.plugins:maven-shade-plugin:[2.0,) or
> one of its dependencies could not be resolved: Failed to read artifact
> descriptor for org.apache.maven.plugins:maven-shade-plugin:jar:[2.0,):
> Could not transfer artifact
> org.apache.maven.plugins:maven-shade-plugin:pom:[2.0,) from/to
> qpass-nexus-hosted-releases (
> http://xxxx:8081/nexus/content/repositories/releases): Illegal
> character in path at index 115:
> http://xxx:8081/nexus/content/repositories/releases/org/apache/maven/p
> lugins/maven-shade-plugin/[2.0,)/maven-shade-plugin-[2.0,).pom-> [Help
> 1]
>
> According to the examples and documentation I have seen, this should work.
>
> Any idea?
>
>
> John "Caolan" Dix
> Programming Sr. SME, Digital Commerce
> Amdocs Mobile Financial Services Division
> o: 206-288-0308 m: 425.351.7340
> AMDOCS | EMBRACE CHALLENGE EXPERIENCE SUCCESS
>
> Did you know...?
> A global consumer survey by Analysys Mason and Amdocs reveals that
> cash is past its prime. Download the new white paper, "Mobile Financial Services:
> The Evolution of Payment" here<http://amdocs.com/mfs-wp>.
>
> Read the latest on Amdocs.com<http://www.amdocs.com/> and the Amdocs
> blog network<http://blogs.amdocs.com/> - and follow us on Facebook<
> https://www.facebook.com/AmdocsMobilePayments>, Twitter<
> https://twitter.com/amdocsmpayments>, LinkedIn<
> http://www.linkedin.com/company/amdocs>, YouTube<
> http://www.youtube.com/amdocs> and Google+<
> https://plus.google.com/+amdocs#+amdocs/posts>
>
>
> This message and the information contained herein is proprietary and
> confidential and subject to the Amdocs policy statement, you may
> review at http://www.amdocs.com/email_disclaimer.asp
>

This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: plugin version ranges errors with Maven 3.1.1

John Dix
In reply to this post by Wayne Fay
We are getting build failures when using 3.1.1 and the 2.0 shade plugin. It seems to be a documented issue:

https://issues.apache.org/jira/browse/STANBOL-1212

So I wanted to be able to have the same parent pom for our builds that still require 3.0.5 which currently sets it to 2.0 and does not run into this error.

-----Original Message-----
From: Wayne Fay [mailto:[hidden email]]
Sent: Friday, December 06, 2013 12:51 PM
To: Maven Users List
Subject: Re: plugin version ranges errors with Maven 3.1.1

> Agreed however I need to support two builds in our environment one
> that uses Maven 3.0.5 and one that does 3.1.1 without having to change the file every time.

Sorry for asking the obvious question, but what prevents you from specifying version [2.0] or whatever and using that with both 3.0.5 and 3.1.1? Is there some incompatibility I am unaware of presently?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Curtis Rueden
Hi John,

You might be able to use profiles to define a different version of
maven-shade-plugin depending on the version of Maven being used. However,
some caveats:

1) There is no explicit profile activation for Maven version. The hack
people use is to activate based on the existence of a property known only
to e.g. Maven 3.x. I am not sure what a good property would be for Maven
3.1 specifically (i.e., not known to 3.0.x), but one probably exists.

2) When it comes to profiles, as Stephen Connolly likes to say: "that way
madness lies." This hack will get your build done for you, but it is a
hack, and you should never forget that it is a hack. Or to put another way:
it's technical debt. When the debt must be paid is unclear, but e.g. if the
maven-shade-plugin produces a different binary result depending on which
version you use, then you may run into apparently bizarre problems with
users who built using Maven 3.1.1 rather than an older version, or vice
versa, and it may take you some time to diagnose *why* it's happening
(surprise: it's because a different version of maven-shade-plugin got
selected!), and so on.

Such problems are why the other posters in this thread are encouraging you
to just choose a version of maven-shade-plugin that works for you. You
*can* put into your POM that it requires a certain minimum Maven version
[1], and Maven will (IIRC) just fail fast if the version is too old. That
is a lot less mysterious than some subtle inconsistency in shaded artifact
build results. And you'll get truly repeatable builds which are one of the
fabulous benefits of a well-structured build system.

Regards,
Curtis

[1] http://maven.apache.org/pom.html#Prerequisites


On Fri, Dec 6, 2013 at 4:20 PM, John Dix <[hidden email]> wrote:

> We are getting build failures when using 3.1.1 and the 2.0 shade plugin.
> It seems to be a documented issue:
>
> https://issues.apache.org/jira/browse/STANBOL-1212
>
> So I wanted to be able to have the same parent pom for our builds that
> still require 3.0.5 which currently sets it to 2.0 and does not run into
> this error.
>
> -----Original Message-----
> From: Wayne Fay [mailto:[hidden email]]
> Sent: Friday, December 06, 2013 12:51 PM
> To: Maven Users List
> Subject: Re: plugin version ranges errors with Maven 3.1.1
>
> > Agreed however I need to support two builds in our environment one
> > that uses Maven 3.0.5 and one that does 3.1.1 without having to change
> the file every time.
>
> Sorry for asking the obvious question, but what prevents you from
> specifying version [2.0] or whatever and using that with both 3.0.5 and
> 3.1.1? Is there some incompatibility I am unaware of presently?
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> This message and the information contained herein is proprietary and
> confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
>
Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Ron Wheeler
Is there some incompatibility of the current version of the shade
plug-in with the older version of Maven?

Generally new versions of legacy software come into existence to solve
some bugs that have been found.

Stephen Connolly's characterization of profiles is certainly born out by
some of the issues raised n this forum.
The concept of a "technical debt" is a good way to look at it.
It is just difficult to know how much you have borrowed and the interest
rate gets to usury levels pretty quickly for some people.

Ron

On 06/12/2013 5:34 PM, Curtis Rueden wrote:

> Hi John,
>
> You might be able to use profiles to define a different version of
> maven-shade-plugin depending on the version of Maven being used. However,
> some caveats:
>
> 1) There is no explicit profile activation for Maven version. The hack
> people use is to activate based on the existence of a property known only
> to e.g. Maven 3.x. I am not sure what a good property would be for Maven
> 3.1 specifically (i.e., not known to 3.0.x), but one probably exists.
>
> 2) When it comes to profiles, as Stephen Connolly likes to say: "that way
> madness lies." This hack will get your build done for you, but it is a
> hack, and you should never forget that it is a hack. Or to put another way:
> it's technical debt. When the debt must be paid is unclear, but e.g. if the
> maven-shade-plugin produces a different binary result depending on which
> version you use, then you may run into apparently bizarre problems with
> users who built using Maven 3.1.1 rather than an older version, or vice
> versa, and it may take you some time to diagnose *why* it's happening
> (surprise: it's because a different version of maven-shade-plugin got
> selected!), and so on.
>
> Such problems are why the other posters in this thread are encouraging you
> to just choose a version of maven-shade-plugin that works for you. You
> *can* put into your POM that it requires a certain minimum Maven version
> [1], and Maven will (IIRC) just fail fast if the version is too old. That
> is a lot less mysterious than some subtle inconsistency in shaded artifact
> build results. And you'll get truly repeatable builds which are one of the
> fabulous benefits of a well-structured build system.
>
> Regards,
> Curtis
>
> [1] http://maven.apache.org/pom.html#Prerequisites
>
>
> On Fri, Dec 6, 2013 at 4:20 PM, John Dix <[hidden email]> wrote:
>
>> We are getting build failures when using 3.1.1 and the 2.0 shade plugin.
>> It seems to be a documented issue:
>>
>> https://issues.apache.org/jira/browse/STANBOL-1212
>>
>> So I wanted to be able to have the same parent pom for our builds that
>> still require 3.0.5 which currently sets it to 2.0 and does not run into
>> this error.
>>
>> -----Original Message-----
>> From: Wayne Fay [mailto:[hidden email]]
>> Sent: Friday, December 06, 2013 12:51 PM
>> To: Maven Users List
>> Subject: Re: plugin version ranges errors with Maven 3.1.1
>>
>>> Agreed however I need to support two builds in our environment one
>>> that uses Maven 3.0.5 and one that does 3.1.1 without having to change
>> the file every time.
>>
>> Sorry for asking the obvious question, but what prevents you from
>> specifying version [2.0] or whatever and using that with both 3.0.5 and
>> 3.1.1? Is there some incompatibility I am unaware of presently?
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>> This message and the information contained herein is proprietary and
>> confidential and subject to the Amdocs policy statement,
>> you may review at http://www.amdocs.com/email_disclaimer.asp
>>


--
Ron Wheeler
President
Artifact Software Inc
email: [hidden email]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: plugin version ranges errors with Maven 3.1.1

Mark Derricutt
In reply to this post by Ron Wheeler
Unless you need them, and limit their usage to your OWN packages.

However - you did fail to mention simply that: version ranges are not, and AFAIK have NEVER been supported for plugins or parents.

Mark

On 7 Dec 2013, at 9:19, Ron Wheeler wrote:

> Version ranges are generally a bad idea.

signature.asc (506 bytes) Download Attachment