You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matthew McCullough <ma...@ambientideas.com> on 2007/08/22 17:18:56 UTC

Can mvn release:prepare be overridden to allow SNAPSHOTs?

Mavenites,

I have a project in which we depend on SNAPSHOTs.  Unfortunately, three of
them are not actively being developed at the moment, however we still have
to use them.  I realize it is a very bad practice to depend on these since
you never know what is going to be changed.  However, is there any way I can
override release:prepare from FORCING me to have all dependencies as
non-snapshots?

I've reviewed all the documentation I can find on:
http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
and cannot find anything that seems to allow overriding this behavior of
requiring all concrete version numbers for dependencies.

Thanks for any pointers.

Matthew McCullough
Ambient Ideas, LLC
matthewm@ambientideas.com
www.ambientideas.com
-- 
View this message in context: http://www.nabble.com/Can-mvn-release%3Aprepare-be-overridden-to-allow-SNAPSHOTs--tf4312271s177.html#a12276968
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: Can mvn release:prepare be overridden to allow SNAPSHOTs?

Posted by Nick Stolwijk <ni...@planet.nl>.
If you really want to get fancy, this is also possible. Only this 
requires a little more hacking.

Take a look at [1] which checks the dependencies, especially line 171 to 
174.

                                prompter.showMessage(
                                    "This project relies on a SNAPSHOT 
of the release plugin. This may be necessary during testing." );
                                result = prompter.prompt( "Do you want 
to continue with the release?",
                                                          Arrays.asList( 
new String[]{"yes", "no"} ), "no" );

If you incorporate something like this on lines 231 and 232 it is the 
brute way. You accept all snapshots or not. If you like something even 
more fancy ;) you can incorporate it at the checkArtifact method on line 
261 you can even fine tune it, so it will ask for each snapshot found.

Do the same with the versions as I explained in the other mail and 
you're set. If you even introduce a variable to turn this on and off, 
maybe it can make it into the official build.

Hth,

Nick Stolwijk

[1] 
http://svn.apache.org/repos/asf/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java

Matthew McCullough wrote:
> Thanks for the workaround.  You are right -- that could get really tedious in
> following the thread of SNAPSHOTs.  I will give it a try.  But I really wish
> there were an option to flat out "override" the release plugin to
> acknowledge "I'm doing something really dangerous but let me do it
> anyway"...
>
> -Matthew
>
>
> Steven Rowe wrote:
>   
>> Hi Matthew,
>>
>> I have gotten around this problem by deploying the SNAPSHOT projects in
>> question to an internal repository, after first renaming their versions
>> from X.X.X-SNAPSHOT to X.X.X-myco-X (or something similar).  This can
>> get messy, since SNAPSHOTs sometimes depend on other SNAPSHOTs, and
>> those have to also be fixed in the respective POMs.  But it works.  And
>> it's worth it - maven-release-plugin rocks!
>>
>> Steve
>>
>> Matthew McCullough wrote:
>>     
>>> Mavenites,
>>>
>>> I have a project in which we depend on SNAPSHOTs.  Unfortunately, three
>>> of
>>> them are not actively being developed at the moment, however we still
>>> have
>>> to use them.  I realize it is a very bad practice to depend on these
>>> since
>>> you never know what is going to be changed.  However, is there any way I
>>> can
>>> override release:prepare from FORCING me to have all dependencies as
>>> non-snapshots?
>>>
>>> I've reviewed all the documentation I can find on:
>>> http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
>>> and cannot find anything that seems to allow overriding this behavior of
>>> requiring all concrete version numbers for dependencies.
>>>
>>> Thanks for any pointers.
>>>
>>> Matthew McCullough
>>> Ambient Ideas, LLC
>>> matthewm@ambientideas.com
>>> www.ambientideas.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: Can mvn release:prepare be overridden to allow SNAPSHOTs?

Posted by Matthew McCullough <ma...@ambientideas.com>.
Thanks for the workaround.  You are right -- that could get really tedious in
following the thread of SNAPSHOTs.  I will give it a try.  But I really wish
there were an option to flat out "override" the release plugin to
acknowledge "I'm doing something really dangerous but let me do it
anyway"...

-Matthew


Steven Rowe wrote:
> 
> Hi Matthew,
> 
> I have gotten around this problem by deploying the SNAPSHOT projects in
> question to an internal repository, after first renaming their versions
> from X.X.X-SNAPSHOT to X.X.X-myco-X (or something similar).  This can
> get messy, since SNAPSHOTs sometimes depend on other SNAPSHOTs, and
> those have to also be fixed in the respective POMs.  But it works.  And
> it's worth it - maven-release-plugin rocks!
> 
> Steve
> 
> Matthew McCullough wrote:
>> Mavenites,
>> 
>> I have a project in which we depend on SNAPSHOTs.  Unfortunately, three
>> of
>> them are not actively being developed at the moment, however we still
>> have
>> to use them.  I realize it is a very bad practice to depend on these
>> since
>> you never know what is going to be changed.  However, is there any way I
>> can
>> override release:prepare from FORCING me to have all dependencies as
>> non-snapshots?
>> 
>> I've reviewed all the documentation I can find on:
>> http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
>> and cannot find anything that seems to allow overriding this behavior of
>> requiring all concrete version numbers for dependencies.
>> 
>> Thanks for any pointers.
>> 
>> Matthew McCullough
>> Ambient Ideas, LLC
>> matthewm@ambientideas.com
>> www.ambientideas.com
> 
> 
> ---------------------------------------------------------------------
> 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/Can-mvn-release%3Aprepare-be-overridden-to-allow-SNAPSHOTs--tf4312271s177.html#a12278067
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: Can mvn release:prepare be overridden to allow SNAPSHOTs?

Posted by Nick Stolwijk <ni...@planet.nl>.
I think it is very simple and also easy to keep up to date.

Start with checking out the Release Manager and the plugin:

svn co http://svn.apache.org/repos/asf/maven/release/trunk release

Change the file 
maven-release-manager/src/main/resources/META-INF/plexus/components.xml 
to reflect the phase change (Comment the line which read: 
<phase>check-dependency-snapshots</phase>.

Change the version number in maven-release-manager/pom.xml to reflect 
your change. (I usually change it into something with my companyname 
included and my own version number, ie. 1.0-alpha-4-company-1.

Change the maven-release-plugin/pom.xml for the release-manager version 
change and change the version number of the plugin to reflect your own 
change.

Install or deploy into your repository and there you go!

If you want to update your version of the plugin, just run a svn up, 
change the version numbers in the pom file to reflect your changes and 
install and deploy again.

Hth,

Nick Stolwijk

Matthew McCullough wrote:
> Wow.  Thanks for the very insightful approach.  It's kind of a very invasive
> one in changing "code", but one that I may very well need to use if I keep
> having to cut a release of our project that depends on these SNAPSHOTs.
>
> -Matthew
>
>
> nick_stolwijk wrote:
>   
>> Another solution is to check out the release manager and remove that 
>> phase from the components.xml and release an own version of the release 
>> manager and release plugin. It is not a nice way, though.
>>
>> Hth,
>>
>> Nick Stolwijk
>>
>> Steven Rowe wrote:
>>     
>>> Hi Matthew,
>>>
>>> I have gotten around this problem by deploying the SNAPSHOT projects in
>>> question to an internal repository, after first renaming their versions
>>> from X.X.X-SNAPSHOT to X.X.X-myco-X (or something similar).  This can
>>> get messy, since SNAPSHOTs sometimes depend on other SNAPSHOTs, and
>>> those have to also be fixed in the respective POMs.  But it works.  And
>>> it's worth it - maven-release-plugin rocks!
>>>
>>> Steve
>>>
>>> Matthew McCullough wrote:
>>>   
>>>       
>>>> Mavenites,
>>>>
>>>> I have a project in which we depend on SNAPSHOTs.  Unfortunately, three
>>>> of
>>>> them are not actively being developed at the moment, however we still
>>>> have
>>>> to use them.  I realize it is a very bad practice to depend on these
>>>> since
>>>> you never know what is going to be changed.  However, is there any way I
>>>> can
>>>> override release:prepare from FORCING me to have all dependencies as
>>>> non-snapshots?
>>>>
>>>> I've reviewed all the documentation I can find on:
>>>> http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
>>>> and cannot find anything that seems to allow overriding this behavior of
>>>> requiring all concrete version numbers for dependencies.
>>>>
>>>> Thanks for any pointers.
>>>>
>>>> Matthew McCullough
>>>> Ambient Ideas, LLC
>>>> matthewm@ambientideas.com
>>>> www.ambientideas.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
>>
>>
>>
>>     
>
>   


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


Re: Can mvn release:prepare be overridden to allow SNAPSHOTs?

Posted by Matthew McCullough <ma...@ambientideas.com>.
Wow.  Thanks for the very insightful approach.  It's kind of a very invasive
one in changing "code", but one that I may very well need to use if I keep
having to cut a release of our project that depends on these SNAPSHOTs.

-Matthew


nick_stolwijk wrote:
> 
> Another solution is to check out the release manager and remove that 
> phase from the components.xml and release an own version of the release 
> manager and release plugin. It is not a nice way, though.
> 
> Hth,
> 
> Nick Stolwijk
> 
> Steven Rowe wrote:
>> Hi Matthew,
>>
>> I have gotten around this problem by deploying the SNAPSHOT projects in
>> question to an internal repository, after first renaming their versions
>> from X.X.X-SNAPSHOT to X.X.X-myco-X (or something similar).  This can
>> get messy, since SNAPSHOTs sometimes depend on other SNAPSHOTs, and
>> those have to also be fixed in the respective POMs.  But it works.  And
>> it's worth it - maven-release-plugin rocks!
>>
>> Steve
>>
>> Matthew McCullough wrote:
>>   
>>> Mavenites,
>>>
>>> I have a project in which we depend on SNAPSHOTs.  Unfortunately, three
>>> of
>>> them are not actively being developed at the moment, however we still
>>> have
>>> to use them.  I realize it is a very bad practice to depend on these
>>> since
>>> you never know what is going to be changed.  However, is there any way I
>>> can
>>> override release:prepare from FORCING me to have all dependencies as
>>> non-snapshots?
>>>
>>> I've reviewed all the documentation I can find on:
>>> http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
>>> and cannot find anything that seems to allow overriding this behavior of
>>> requiring all concrete version numbers for dependencies.
>>>
>>> Thanks for any pointers.
>>>
>>> Matthew McCullough
>>> Ambient Ideas, LLC
>>> matthewm@ambientideas.com
>>> www.ambientideas.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Can-mvn-release%3Aprepare-be-overridden-to-allow-SNAPSHOTs--tf4312271s177.html#a12278070
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: Can mvn release:prepare be overridden to allow SNAPSHOTs?

Posted by Nick Stolwijk <ni...@planet.nl>.
Another solution is to check out the release manager and remove that 
phase from the components.xml and release an own version of the release 
manager and release plugin. It is not a nice way, though.

Hth,

Nick Stolwijk

Steven Rowe wrote:
> Hi Matthew,
>
> I have gotten around this problem by deploying the SNAPSHOT projects in
> question to an internal repository, after first renaming their versions
> from X.X.X-SNAPSHOT to X.X.X-myco-X (or something similar).  This can
> get messy, since SNAPSHOTs sometimes depend on other SNAPSHOTs, and
> those have to also be fixed in the respective POMs.  But it works.  And
> it's worth it - maven-release-plugin rocks!
>
> Steve
>
> Matthew McCullough wrote:
>   
>> Mavenites,
>>
>> I have a project in which we depend on SNAPSHOTs.  Unfortunately, three of
>> them are not actively being developed at the moment, however we still have
>> to use them.  I realize it is a very bad practice to depend on these since
>> you never know what is going to be changed.  However, is there any way I can
>> override release:prepare from FORCING me to have all dependencies as
>> non-snapshots?
>>
>> I've reviewed all the documentation I can find on:
>> http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
>> and cannot find anything that seems to allow overriding this behavior of
>> requiring all concrete version numbers for dependencies.
>>
>> Thanks for any pointers.
>>
>> Matthew McCullough
>> Ambient Ideas, LLC
>> matthewm@ambientideas.com
>> www.ambientideas.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: Can mvn release:prepare be overridden to allow SNAPSHOTs?

Posted by Steven Rowe <sa...@syr.edu>.
Hi Matthew,

I have gotten around this problem by deploying the SNAPSHOT projects in
question to an internal repository, after first renaming their versions
from X.X.X-SNAPSHOT to X.X.X-myco-X (or something similar).  This can
get messy, since SNAPSHOTs sometimes depend on other SNAPSHOTs, and
those have to also be fixed in the respective POMs.  But it works.  And
it's worth it - maven-release-plugin rocks!

Steve

Matthew McCullough wrote:
> Mavenites,
> 
> I have a project in which we depend on SNAPSHOTs.  Unfortunately, three of
> them are not actively being developed at the moment, however we still have
> to use them.  I realize it is a very bad practice to depend on these since
> you never know what is going to be changed.  However, is there any way I can
> override release:prepare from FORCING me to have all dependencies as
> non-snapshots?
> 
> I've reviewed all the documentation I can find on:
> http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
> and cannot find anything that seems to allow overriding this behavior of
> requiring all concrete version numbers for dependencies.
> 
> Thanks for any pointers.
> 
> Matthew McCullough
> Ambient Ideas, LLC
> matthewm@ambientideas.com
> www.ambientideas.com


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