НА: can't get two things done

56 views
Skip to first unread message

Oleg Estekhin

unread,
Jul 12, 2013, 2:15:38 PM7/12/13
to JC, maven-svn-revisi...@googlegroups.com
Hi,

Can you try to run the plugin in the verbose mode to check what properties it sets?

The plugin does not support configuration/include option so you can remove it.
The depth option means exactly the same as depth option of the svn command line program, so its value is not a number but one of the predefined string constants. Please, check the documentation at http://maven-svn-revision-number-plugin.googlecode.com/svn/site/usage.html.

best regards,
Oleg


Отправлено с моего Windows Phone

От: JC
Отправлено: 12.07.2013 21:20
Кому: maven-svn-revisi...@googlegroups.com
Тема: can't get two things done

Hello all
I was more than happy to find about this plugin, but I ran into a few issues:
- I thought the depth actually means something, but running mvn --debug I see it always traverses the whole directory structure... but I'd want only the first level
- I can't get it to write the properties file, it simply does nothing. I have the src/main/resources/revision.txt file with the recommended contents, and here's the pom - I  would really appreciate if you can point me why it is happening...
Thank you!

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
                <artifactId>svn-revision-number-maven-plugin</artifactId>
                <version>1.13</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>src/main/java/**/*.java</include>
                    </includes>
                    <entries>
                        <entry>
                            <depth>1</depth>
                            <prefix>prefix</prefix>
                        </entry>
                    </entries>
                </configuration>
            </plugin>

--
You received this message because you are subscribed to the Google Groups "maven-svn-revision-number-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-svn-revision-num...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

JC

unread,
Jul 15, 2013, 4:45:48 AM7/15/13
to maven-svn-revisi...@googlegroups.com
Hi Oleg,

thank you for the SVN tip, it's "immediate" that I need.

The plugin shows in debug mode it would set all the interesting properties. I just don't have them written in file... here's its relevant output pasted from the console after running "mvn svn-revision-number:revision --debug":
[DEBUG] setting properties
[DEBUG]   prefix.repository = svn://mymachine.name
[DEBUG]   prefix.path = trunk/myproject
[DEBUG]   prefix.revision = 72005
[DEBUG]   prefix.mixedRevisions = true
[DEBUG]   prefix.committedRevision = 72005
[DEBUG]   prefix.committedDate = 2013-07-12 18:38:21 +0200 (Fri, 12 Jul 2013)
[DEBUG]   prefix.status = M?
[DEBUG]   prefix.specialStatus = Mu
[INFO] -----------------------------------------------------------------------
[INFO] BUILD SUCCESS

...and here's the contents of \src\main\resources\revision.txt:
repository = ${prefix.repository}
path = ${prefix.path}
revision = ${prefix.revision}
mixedRevisions = ${prefix.mixedRevisions}
committedRevision = ${prefix.committedRevision}
committedDate = ${prefix.committedDate}
status = ${prefix.status}
specialStatus = ${prefix.specialStatus}

Thank you!
JC

Oleg Estekhin

unread,
Jul 16, 2013, 2:07:41 PM7/16/13
to maven-svn-revisi...@googlegroups.com
Hi,
 
you need to configure maven to filter your resource files as described in the http://maven-svn-revision-number-plugin.googlecode.com/svn/site/examples/resource_filtering.html
Reply all
Reply to author
Forward
0 new messages