Re: Property that indicates a snapshot or release build?
If you are using the Maven Release Plugin you can use the releaseProfiles [1] configuration option in the perform goal [2] to activate a specific profile during a release build. In that profile you can override your specific configuration. The idea is to configure your POM for snapshot builds by default, and override that configuration in a profile which will be activated only during release build. [1]: http://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html#releaseProfiles [2]: http://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html 2014/1/19 Graham Leggett minf...@sharp.fm: Hi all, Does there exist a property in maven that will indicate in some fashion whether the build is a snapshot build or a release build? I am aware that -SNAPSHOT appears in the version number, but that won't do. I'm after a variable that has one of two discrete values, one predictable value if it is a snapshot and another predictable value when it is a release. Does anything like this exist? Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Property that indicates a snapshot or release build?
Yes, there is methods isSnapshot() and isRelease() if you get the Artifact object. See [1]. /Anders [1] http://maven.apache.org/ref/3.1.1/maven-artifact/apidocs/index.html On Sun, Jan 19, 2014 at 4:43 PM, Graham Leggett minf...@sharp.fm wrote: Hi all, Does there exist a property in maven that will indicate in some fashion whether the build is a snapshot build or a release build? I am aware that -SNAPSHOT appears in the version number, but that won't do. I'm after a variable that has one of two discrete values, one predictable value if it is a snapshot and another predictable value when it is a release. Does anything like this exist? Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Property that indicates a snapshot or release build?
On 19 Jan 2014, at 5:59 PM, Anders Hammar and...@hammar.net wrote: Yes, there is methods isSnapshot() and isRelease() if you get the Artifact object. See [1]. /Anders [1] http://maven.apache.org/ref/3.1.1/maven-artifact/apidocs/index.html Is there a practical example anywhere of how this could be referred to from a maven variable? Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Property that indicates a snapshot or release build?
Don't understand. You need to, through code, get hold of the artifact objects. /Anders On Sun, Jan 19, 2014 at 5:17 PM, Graham Leggett minf...@sharp.fm wrote: On 19 Jan 2014, at 5:59 PM, Anders Hammar and...@hammar.net wrote: Yes, there is methods isSnapshot() and isRelease() if you get the Artifact object. See [1]. /Anders [1] http://maven.apache.org/ref/3.1.1/maven-artifact/apidocs/index.html Is there a practical example anywhere of how this could be referred to from a maven variable? Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Property that indicates a snapshot or release build?
On 19 Jan 2014, at 6:20 PM, Anders Hammar and...@hammar.net wrote: Don't understand. You need to, through code, get hold of the artifact objects. I am trying to get access to this from a property. What I need is a property that I can embed in a path inside the pom. If the artefact is a release, the property is one value, while if the artefact is a snapshot, the property is another. The project.version property comes achingly close, but won't work for me because it will change on every release. Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Property that indicates a snapshot or release build?
OK, then I don't know. Don't think there is a property. /Anders On Sun, Jan 19, 2014 at 5:24 PM, Graham Leggett minf...@sharp.fm wrote: On 19 Jan 2014, at 6:20 PM, Anders Hammar and...@hammar.net wrote: Don't understand. You need to, through code, get hold of the artifact objects. I am trying to get access to this from a property. What I need is a property that I can embed in a path inside the pom. If the artefact is a release, the property is one value, while if the artefact is a snapshot, the property is another. The project.version property comes achingly close, but won't work for me because it will change on every release. Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Property that indicates a snapshot or release build?
Sounds like a candidate enhancement for build-helper-maven-plugin -D On Sunday, January 19, 2014, Graham Leggett minf...@sharp.fm wrote: On 19 Jan 2014, at 6:20 PM, Anders Hammar and...@hammar.netjavascript:; wrote: Don't understand. You need to, through code, get hold of the artifact objects. I am trying to get access to this from a property. What I need is a property that I can embed in a path inside the pom. If the artefact is a release, the property is one value, while if the artefact is a snapshot, the property is another. The project.version property comes achingly close, but won't work for me because it will change on every release. Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org javascript:; For additional commands, e-mail: users-h...@maven.apache.orgjavascript:;
Re: Property that indicates a snapshot or release build?
Sounds like a candidate enhancement for build-helper-maven-plugin -D On Sunday, January 19, 2014, Graham Leggett minf...@sharp.fm wrote: On 19 Jan 2014, at 6:20 PM, Anders Hammar and...@hammar.netjavascript:; wrote: Don't understand. You need to, through code, get hold of the artifact objects. I am trying to get access to this from a property. What I need is a property that I can embed in a path inside the pom. If the artefact is a release, the property is one value, while if the artefact is a snapshot, the property is another. The project.version property comes achingly close, but won't work for me because it will change on every release. Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org javascript:; For additional commands, e-mail: users-h...@maven.apache.orgjavascript:;
Re: Property that indicates a snapshot or release build?
+1. At least I agree I don't think there's already a property for that. Le 19 janv. 2014 22:20, Dan Tran dant...@gmail.com a écrit : Sounds like a candidate enhancement for build-helper-maven-plugin -D On Sunday, January 19, 2014, Graham Leggett minf...@sharp.fm wrote: On 19 Jan 2014, at 6:20 PM, Anders Hammar and...@hammar.net javascript:; wrote: Don't understand. You need to, through code, get hold of the artifact objects. I am trying to get access to this from a property. What I need is a property that I can embed in a path inside the pom. If the artefact is a release, the property is one value, while if the artefact is a snapshot, the property is another. The project.version property comes achingly close, but won't work for me because it will change on every release. Regards, Graham -- - To unsubscribe, e-mail: users-unsubscr...@maven.apache.orgjavascript:; For additional commands, e-mail: users-h...@maven.apache.org javascript:;