You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Paul Gier (JIRA)" <ji...@codehaus.org> on 2009/03/23 20:07:12 UTC
[jira] Created: (MNG-4105) Allow access to components of a parsed
version through properties.
Allow access to components of a parsed version through properties.
------------------------------------------------------------------
Key: MNG-4105
URL: http://jira.codehaus.org/browse/MNG-4105
Project: Maven 2
Issue Type: New Feature
Reporter: Paul Gier
There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
${project.version} = 2.0.1-beta-1
${project.version.major} = 2
${project.version.minor} = 0
${project.version.incremental} = 1
${project.version.qualifier} = beta
${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173707#action_173707 ]
Don Laidlaw commented on MNG-4105:
----------------------------------
Great! The build helper would be a great home until the feature is added into core maven.
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2
> Issue Type: New Feature
> Reporter: Paul Gier
> Fix For: 2.2.0-M1
>
> Attachments: com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar, com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Raja Kannappan (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212858#action_212858 ]
Raja Kannappan commented on MNG-4105:
-------------------------------------
Is this plugin available in any public repository or is this part of maven build helper plugin as Paul's comment says?
Thanks.
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2 & 3
> Issue Type: New Feature
> Reporter: Paul Gier
> Attachments: com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar, com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173703#action_173703 ]
Paul Gier commented on MNG-4105:
--------------------------------
Thanks Don! Maybe I'll add this as a mojo in the build helper maven plugin. What do you think?
I think it would still be nice to also have this available automatically without the need for a plugin. So I will still try to add the feature to the core maven components.
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2
> Issue Type: New Feature
> Reporter: Paul Gier
> Fix For: 2.2.0-M1
>
> Attachments: com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar, com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter closed MNG-4105.
-----------------------------
Resolution: Won't Fix
Fix Version/s: (was: 2.3.x)
plugin seems good enough for now. Paul, if you want to work on it, feel free to reopen and implement on trunk with ITs and all that :)
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2 & 3
> Issue Type: New Feature
> Reporter: Paul Gier
> Attachments: com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar, com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Laidlaw updated MNG-4105:
-----------------------------
Attachment: com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar
Simple version utility plugin for maven. Including source code. Share and enjoy :)
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2
> Issue Type: New Feature
> Reporter: Paul Gier
> Fix For: 2.2.0-M1
>
> Attachments: com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar, com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212861#action_212861 ]
Paul Gier commented on MNG-4105:
--------------------------------
The build helper plugin contains a parse version goal and [1] is available in the central repository.
[1]http://mojo.codehaus.org/build-helper-maven-plugin/index.html
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2 & 3
> Issue Type: New Feature
> Reporter: Paul Gier
> Attachments: com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar, com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Raja Kannappan (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212939#action_212939 ]
Raja Kannappan commented on MNG-4105:
-------------------------------------
Thanks! It works great!
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2 & 3
> Issue Type: New Feature
> Reporter: Paul Gier
> Attachments: com.infor.maven.plugin.version-1.0.0-SNAPSHOT-sources.jar, com.infor.maven.plugin.version-1.0.0-SNAPSHOT.jar
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173688#action_173688 ]
Don Laidlaw commented on MNG-4105:
----------------------------------
This turns out to be extremely easy to do with a plugin. I wrote a simple plugin to take the project version and set project properties for all the version parts. I also added an OSGi compatible property. The plugin and source will be attached shortly. Meanwhile, I used it like this...
{code} <plugin>
<groupId>com.infor.maven</groupId>
<artifactId>com.infor.maven.plugin.version</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>osgi-version</id>
<phase>verify</phase>
<goals>
<goal>version</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>${source.plugin.phase}</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifestEntries>
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
<Bundle-Name>${name}</Bundle-Name>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Vendor>${organization.name}</Bundle-Vendor>
<Bundle-Version>${versionUtil.osgi}</Bundle-Version>
<Eclipse-SourceBundle>${artifactId};version="${versionUtil.osgi}";roots:="."</Eclipse-SourceBundle>
</manifestEntries>
</archive>
</configuration>
</plugin>
{code}
The versionUtil.osgi property referenced in the manifest is created by the first plugin. Other properties are:
* versionUtil.major
* versionUtil.minor
* versionUtil.incremental
* versionUtil.build
* versionUtil.qualifier
You can change the name of the properties by adding configuration to the plugin.
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2
> Issue Type: New Feature
> Reporter: Paul Gier
> Fix For: 2.2.0-M1
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter updated MNG-4105:
------------------------------
Fix Version/s: 2.2.0-M1
because of the way this is handled, I think it would need to be ${project.versionParts.X} instead, so we can add getVersionParts() to MavenProject to construct the ArtifactVersion.
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2
> Issue Type: New Feature
> Reporter: Paul Gier
> Fix For: 2.2.0-M1
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-4105) Allow access to components of a parsed
version through properties.
Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=170811#action_170811 ]
Paul Gier commented on MNG-4105:
--------------------------------
That's fine. I'm not too picky about what the actual name of the property is, just as long as there is an easy way to access it.
> Allow access to components of a parsed version through properties.
> ------------------------------------------------------------------
>
> Key: MNG-4105
> URL: http://jira.codehaus.org/browse/MNG-4105
> Project: Maven 2
> Issue Type: New Feature
> Reporter: Paul Gier
> Fix For: 2.2.0-M1
>
>
> There are some cases where I would like more fine grained access to the project version number. It would be convenient if I could access individual parts of a version string using properties. For example, a project with version "2.0.1-beta-1" I would like to be able to use the following properties or something similar:
> ${project.version} = 2.0.1-beta-1
> ${project.version.major} = 2
> ${project.version.minor} = 0
> ${project.version.incremental} = 1
> ${project.version.qualifier} = beta
> ${project.version.buildNumber} = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira