You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Michael Hüttermann <mi...@huettermann.net> on 2011/08/11 17:59:20 UTC

the revision number and a tag

 Hello,

 given a Subversion tag, what's the best way to get the revision number 
 of that tag, i.e. the revision number with which the tag was created? Is 
 it possible at all having checked out the tag to a local working copy? 
 Or is there any other way to cross-reference a "tag" to a revision 
 number?


 Thanks.


 Michael


Re: Discrepancy in SNAPSHOT jar filename between JAR Plugin and Assembly Plugin

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 11, 2011, at 11:34, Michael Remijan wrote:

> I am seeing an interesting discrepancy between the JAR plugin and the Assembly plugin.  

This message doesn't relate to the "revision number and a tag" thread to which you replied. Please always create a new message (not a reply) when you have a new topic to discuss.

http://subversion.apache.org/docs/community-guide/mailing-lists.html#fresh-post



RE: Discrepancy in SNAPSHOT jar filename between JAR Plugin and Assembly Plugin

Posted by Robert Scholte <rf...@codehaus.org>.
Looks like the assembly plugin uses somewhere artifact.getVersion() instead of artifact.getBaseVersion().

Please check if there's already such an issue at jira[1], otherwise create the issue yourself.

 

-Robert

 

[1] http://jira.codehaus.org/browse/MASSEMBLY

----------------------------------------
> Date: Thu, 11 Aug 2011 10:51:22 -0700
> From: mjremijan@yahoo.com
> Subject: Discrepancy in SNAPSHOT jar filename between JAR Plugin and Assembly Plugin
> To: users@maven.apache.org
>
> I am seeing an interesting discrepancy between the JAR plugin and the Assembly plugin.
>
> I have the JAR plugin configured to add the dependencies to the MANIFEST:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <configuration>
> <archive>
> <manifest>
> <addClasspath>true</addClasspath>
> <classpathPrefix>lib</classpathPrefix>
> <mainClass>org.myapp.main.Main</mainClass>
> </manifest>
> </archive>
> </configuration>
> </plugin>
>
> The JAR file name will be added to the MANIFEST like this. . .
>
> Class-Path: lib/my-commons-1.0.6-SNAPSHOT.jar [...etc]
>
> So far so good.
>
> Now, I have the Assembly plugin configured to add the dependencies to the /lib directory of an archive:
>
>
> <assembly>
> ....
> <dependencySets>
> <dependencySet>
> <useProjectArtifact>false</useProjectArtifact>
> <outputDirectory>/lib</outputDirectory>
> <useDefaultExcludes>true</useDefaultExcludes>
> </dependencySet>
> </dependencySets>
> </assembly>
>
> When the Assembly plugin builds the archive, the name of the jarfile is NOT my-commons-1.0.6-SNAPSHOT.jar! Instead what I get is "my-commons-1.0.6-20110810.204640-23.jar"
>
>
> $ ll my-commons*
> -rwx------+ 1 mike Users Users 48805 Aug 11 08:53 my-commons-1.0.6-20110810.204640-23.jar
>
> Major Problem!!
>
> Anyone know why this is happening? I am using Maven 2.0.9 and I'm stuck with this version and cannot change it! 		 	   		  
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Discrepancy in SNAPSHOT jar filename between JAR Plugin and Assembly Plugin

Posted by Michael Remijan <mj...@yahoo.com>.
I am seeing an interesting discrepancy between the JAR plugin and the Assembly plugin.  

I have the JAR plugin configured to add the dependencies to the MANIFEST:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>                      
                   <archive>
                       <manifest>
                           <addClasspath>true</addClasspath>
                           <classpathPrefix>lib</classpathPrefix>
                           <mainClass>org.myapp.main.Main</mainClass>
                       </manifest>    
                   </archive>
                </configuration>
            </plugin>

The JAR file name will be added to the MANIFEST like this. . .

        Class-Path: lib/my-commons-1.0.6-SNAPSHOT.jar [...etc]

So far so good.

Now, I have the Assembly plugin configured to add the dependencies to the /lib directory of an archive:


<assembly>
....
    <dependencySets>
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>/lib</outputDirectory>
            <useDefaultExcludes>true</useDefaultExcludes>
        </dependencySet>
    </dependencySets>
</assembly>

When the Assembly plugin builds the archive, the name of the jarfile is NOT my-commons-1.0.6-SNAPSHOT.jar!  Instead what I get is "my-commons-1.0.6-20110810.204640-23.jar"


$ ll my-commons*
-rwx------+ 1 mike Users Users 48805 Aug 11 08:53 my-commons-1.0.6-20110810.204640-23.jar

Major Problem!! 

Anyone know why this is happening?  I am using Maven 2.0.9 and I'm stuck with this version and cannot change it!

Discrepancy in SNAPSHOT jar filename between JAR Plugin and Assembly Plugin

Posted by Michael Remijan <mj...@yahoo.com>.
I am seeing an interesting discrepancy between the JAR plugin and the Assembly plugin.  

I have the JAR plugin configured to add the dependencies to the MANIFEST:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>                      
                   <archive>
                       <manifest>
                           <addClasspath>true</addClasspath>
                           <classpathPrefix>lib</classpathPrefix>
                           <mainClass>org.myapp.main.Main</mainClass>
                       </manifest>    
                   </archive>
                </configuration>
            </plugin>

The JAR file name will be added to the MANIFEST like this. . .

        Class-Path: lib/my-commons-1.0.6-SNAPSHOT.jar [...etc]

So far so good.

Now, I have the Assembly plugin configured to add the dependencies to the /lib directory of an archive:


<assembly>
....
    <dependencySets>
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>/lib</outputDirectory>
            <useDefaultExcludes>true</useDefaultExcludes>
        </dependencySet>
    </dependencySets>
</assembly>

When the Assembly plugin builds the archive, the name of the jarfile is NOT my-commons-1.0.6-SNAPSHOT.jar!  Instead what I get is "my-commons-1.0.6-20110810.204640-23.jar"


$ ll my-commons*
-rwx------+ 1 mike Users Users 48805 Aug 11 08:53 my-commons-1.0.6-20110810.204640-23.jar

Major Problem!! 

Anyone know why this is happening?  I am using Maven 2.0.9 and I'm stuck with this version and cannot change it!

Re: the revision number and a tag

Posted by Mark Phippard <ma...@gmail.com>.
On Thu, Aug 11, 2011 at 11:59 AM, Michael Hüttermann <
michael@huettermann.net> wrote:

>
> given a Subversion tag, what's the best way to get the revision number of
> that tag, i.e. the revision number with which the tag was created? Is it
> possible at all having checked out the tag to a local working copy? Or is
> there any other way to cross-reference a "tag" to a revision number?
>

Simple way is just to use svn info and look for the Last Changed Revision:

$ svn info http://svn.apache.org/repos/asf/subversion/tags/1.6.17
Path: 1.6.17
URL: http://svn.apache.org/repos/asf/subversion/tags/1.6.17
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 1156659
Node Kind: directory
Last Changed Author: hwright
Last Changed Rev: 1130806
Last Changed Date: 2011-06-02 16:49:07 -0400 (Thu, 02 Jun 2011)


-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: the revision number and a tag

Posted by Johan Corveleyn <jc...@gmail.com>.
On Thu, Aug 11, 2011 at 6:16 PM, Andy Levy <an...@gmail.com> wrote:
> On Thu, Aug 11, 2011 at 12:13, Andy Levy <an...@gmail.com> wrote:
>> On Thu, Aug 11, 2011 at 12:02, Giulio Troccoli
>> <gi...@mediatelgroup.co.uk> wrote:
>>>
>>>
>>> On 11/08/11 16:59, Michael Hüttermann wrote:
>>>>
>>>> Hello,
>>>>
>>>> given a Subversion tag, what's the best way to get the revision number of
>>>> that tag, i.e. the revision number with which the tag was created? Is it
>>>> possible at all having checked out the tag to a local working copy? Or is
>>>> there any other way to cross-reference a "tag" to a revision number?
>>>>
>>>>
>>>> Thanks.
>>>>
>>>>
>>>> Michael
>>>>
>>>
>>> I think svn log --limit 1 would work. It will give you the last log when the
>>> tag was modified. Since a tag should never be modified that log should refer
>>> to the copy
>>
>> That or svn log --stop-on-copy.
>>
>> If you use svn log -v --stop-on-copy, the list of changed paths (the
>> copy destination) will be given, in addition to the source path and
>> its revision. Parse that out and you're set. You'll have both the
>> revision which created the tag and the latest revision of the path the
>> tag came from.
>>
>
> I hit Send too early.
>
> If no one has modified the tag, --limit 1 would yield the same results
> as --stop-on-copy. But if someone *has* modified the tag (which we
> agree shouldn't happen, but depending on your setup, it could - that's
> a whole other matter), that modification will appear instead of the
> copy which created the tag. If you use --stop-on-copy, you can detect
> this condition and the oldest log will end up being the creation of
> the tag.

I think the best/easiest way is:

    svn log -r 1:HEAD --limit 1 --stop-on-copy $URL_TO_TAG

(then parse the revision number out of that)

The '-r 1:HEAD' reverses the order of log to return the entries from
oldest to newest. Combining this with --stop-on-copy and --limit 1
gives you exactly the oldest log entry on that tag (which is the copy
operation itself), whether or not it had changes after creation.

This also works for branches (giving you the creation revision of the branch).

-- 
Johan

Re: the revision number and a tag

Posted by Andy Levy <an...@gmail.com>.
On Thu, Aug 11, 2011 at 12:13, Andy Levy <an...@gmail.com> wrote:
> On Thu, Aug 11, 2011 at 12:02, Giulio Troccoli
> <gi...@mediatelgroup.co.uk> wrote:
>>
>>
>> On 11/08/11 16:59, Michael Hüttermann wrote:
>>>
>>> Hello,
>>>
>>> given a Subversion tag, what's the best way to get the revision number of
>>> that tag, i.e. the revision number with which the tag was created? Is it
>>> possible at all having checked out the tag to a local working copy? Or is
>>> there any other way to cross-reference a "tag" to a revision number?
>>>
>>>
>>> Thanks.
>>>
>>>
>>> Michael
>>>
>>
>> I think svn log --limit 1 would work. It will give you the last log when the
>> tag was modified. Since a tag should never be modified that log should refer
>> to the copy
>
> That or svn log --stop-on-copy.
>
> If you use svn log -v --stop-on-copy, the list of changed paths (the
> copy destination) will be given, in addition to the source path and
> its revision. Parse that out and you're set. You'll have both the
> revision which created the tag and the latest revision of the path the
> tag came from.
>

I hit Send too early.

If no one has modified the tag, --limit 1 would yield the same results
as --stop-on-copy. But if someone *has* modified the tag (which we
agree shouldn't happen, but depending on your setup, it could - that's
a whole other matter), that modification will appear instead of the
copy which created the tag. If you use --stop-on-copy, you can detect
this condition and the oldest log will end up being the creation of
the tag.

Re: the revision number and a tag

Posted by Andy Levy <an...@gmail.com>.
On Thu, Aug 11, 2011 at 12:02, Giulio Troccoli
<gi...@mediatelgroup.co.uk> wrote:
>
>
> On 11/08/11 16:59, Michael Hüttermann wrote:
>>
>> Hello,
>>
>> given a Subversion tag, what's the best way to get the revision number of
>> that tag, i.e. the revision number with which the tag was created? Is it
>> possible at all having checked out the tag to a local working copy? Or is
>> there any other way to cross-reference a "tag" to a revision number?
>>
>>
>> Thanks.
>>
>>
>> Michael
>>
>
> I think svn log --limit 1 would work. It will give you the last log when the
> tag was modified. Since a tag should never be modified that log should refer
> to the copy

That or svn log --stop-on-copy.

If you use svn log -v --stop-on-copy, the list of changed paths (the
copy destination) will be given, in addition to the source path and
its revision. Parse that out and you're set. You'll have both the
revision which created the tag and the latest revision of the path the
tag came from.

Re: the revision number and a tag

Posted by Giulio Troccoli <gi...@mediatelgroup.co.uk>.

On 11/08/11 17:02, Giulio Troccoli wrote:
>
>
> On 11/08/11 16:59, Michael Hüttermann wrote:
>>
>> Hello,
>>
>> given a Subversion tag, what's the best way to get the revision 
>> number of that tag, i.e. the revision number with which the tag was 
>> created? Is it possible at all having checked out the tag to a local 
>> working copy? Or is there any other way to cross-reference a "tag" to 
>> a revision number?
>>
>>
>> Thanks.
>>
>>
>> Michael
>>
>
> I think svn log --limit 1 would work. It will give you the last log 
> when the tag was modified. Since a tag should never be modified that 
> log should refer to the copy
>
> G

Obviously there will need to be some parsing of the output if you want 
just the revision number (to be used in a script for example)

Re: the revision number and a tag

Posted by Giulio Troccoli <gi...@mediatelgroup.co.uk>.

On 11/08/11 16:59, Michael Hüttermann wrote:
>
> Hello,
>
> given a Subversion tag, what's the best way to get the revision number 
> of that tag, i.e. the revision number with which the tag was created? 
> Is it possible at all having checked out the tag to a local working 
> copy? Or is there any other way to cross-reference a "tag" to a 
> revision number?
>
>
> Thanks.
>
>
> Michael
>

I think svn log --limit 1 would work. It will give you the last log when 
the tag was modified. Since a tag should never be modified that log 
should refer to the copy

G