Problem with Build Number Maven Plugin

View: New views
2 Messages — Rating Filter:   Alert me  

Problem with Build Number Maven Plugin

by Helder Sousa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I am trying to use the Build Number Maven Plugin to put the SVN
Revision in Manifest file.
I configured my plugins like this:

       <build>
               <plugins>
                       <plugin>
                               <artifactId>maven-compiler-plugin</artifactId>
                               <configuration>
                                       <fork>true</fork>
                                       <meminitial>128m</meminitial>
                                       <maxmem>256m</maxmem>
                                       <source>1.5</source>
                                       <target>1.5</target>
                               </configuration>
                       </plugin>
                       <plugin>
                               <groupId>org.apache.maven.plugins</groupId>
                               <artifactId>maven-jar-plugin</artifactId>
                               <configuration>
                                       <archive>
                                               <manifestEntries>

<SCM-Revision>${buildNumber}</SCM-Revision>
                                               </manifestEntries>
                                       </archive>
                               </configuration>
                       </plugin>
                       <plugin>
                               <groupId>org.codehaus.mojo</groupId>
                               <artifactId>buildnumber-maven-plugin</artifactId>
                               <version>1.0-beta-3</version>
                               <executions>
                                       <execution>
                                               <phase>validate</phase>
                                               <goals>
                                                       <goal>create</goal>
                                               </goals>
                                       </execution>
                               </executions>
                               <configuration>
                                       <doCheck>true</doCheck>
                                       <doUpdate>true</doUpdate>
                               </configuration>
                       </plugin>
               </plugins>
       </build>

With this configuration I have the following error:

[INFO] [buildnumber:create {execution: default}]
[INFO] Verifying there are no local modifications ...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive status"
[INFO] Working directory: D:\Java\Eclipse-Workspaces\BizRules\PFW-SuperPOM
Provider message:
The svn command failed.
Command output:
svn: This client is too old to work with working copy '.'; please get
a newer Subversion client


Then I find this page:
http://mojo.codehaus.org/buildnumber-maven-plugin/using-svnjava.html
and change the configuration

                       <plugin>
                               <groupId>org.codehaus.mojo</groupId>
                               <artifactId>buildnumber-maven-plugin</artifactId>
                               <version>1.0-beta-3</version>
                               <executions>
                                       <execution>
                                               <phase>validate</phase>
                                               <goals>
                                                       <goal>create</goal>
                                               </goals>
                                       </execution>
                               </executions>
                               <configuration>
                                       <doCheck>true</doCheck>
                                       <doUpdate>true</doUpdate>
                                       <providerImplementations>
                                               <svn>javasvn</svn>
                                       </providerImplementations>
                               </configuration>
                       </plugin>

With this configuration I have this error:

[INFO] [buildnumber:create {execution: default}]
[INFO] Change the default 'svn' provider implementation to 'javasvn'.
[INFO] Verifying there are no local modifications ...
[INFO] SVN status directory: D:\Java\Eclipse-Workspaces\BizRules\PFW-SuperPOM
[INFO] SVN update directory: D:\Java\Eclipse-Workspaces\BizRules\PFW-SuperPOM
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.apache.maven.scm.command.update.UpdateScmResult cannot be
cast to org.apache.maven.scm.command.update.UpdateScmResultWithRevision
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.ClassCastException:
org.apache.maven.scm.command.update.UpdateScmResult cannot be cast to
org.apache.maven.scm.command.update.UpdateScmResultWithRevision
       at org.codehaus.mojo.build.CreateMojo.update(CreateMojo.java:528)
       at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:398)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Jul 02 17:47:15 BST 2009
[INFO] Final Memory: 11M/21M
[INFO] ------------------------------------------------------------------------

Did I miss some configuration?
Thank you for your help.

Hélder Sousa

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Problem with Build Number Maven Plugin

by Paul Gier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What version is your svn client?  Based on the first problem you ran into, maybe
updating svn would fix the issue for you?

Hélder Sousa wrote:

> Hi all,
>
> I am trying to use the Build Number Maven Plugin to put the SVN
> Revision in Manifest file.
> I configured my plugins like this:
>
>        <build>
>                <plugins>
>                        <plugin>
>                                <artifactId>maven-compiler-plugin</artifactId>
>                                <configuration>
>                                        <fork>true</fork>
>                                        <meminitial>128m</meminitial>
>                                        <maxmem>256m</maxmem>
>                                        <source>1.5</source>
>                                        <target>1.5</target>
>                                </configuration>
>                        </plugin>
>                        <plugin>
>                                <groupId>org.apache.maven.plugins</groupId>
>                                <artifactId>maven-jar-plugin</artifactId>
>                                <configuration>
>                                        <archive>
>                                                <manifestEntries>
>
> <SCM-Revision>${buildNumber}</SCM-Revision>
>                                                </manifestEntries>
>                                        </archive>
>                                </configuration>
>                        </plugin>
>                        <plugin>
>                                <groupId>org.codehaus.mojo</groupId>
>                                <artifactId>buildnumber-maven-plugin</artifactId>
>                                <version>1.0-beta-3</version>
>                                <executions>
>                                        <execution>
>                                                <phase>validate</phase>
>                                                <goals>
>                                                        <goal>create</goal>
>                                                </goals>
>                                        </execution>
>                                </executions>
>                                <configuration>
>                                        <doCheck>true</doCheck>
>                                        <doUpdate>true</doUpdate>
>                                </configuration>
>                        </plugin>
>                </plugins>
>        </build>
>
> With this configuration I have the following error:
>
> [INFO] [buildnumber:create {execution: default}]
> [INFO] Verifying there are no local modifications ...
> [INFO] Executing: cmd.exe /X /C "svn --non-interactive status"
> [INFO] Working directory: D:\Java\Eclipse-Workspaces\BizRules\PFW-SuperPOM
> Provider message:
> The svn command failed.
> Command output:
> svn: This client is too old to work with working copy '.'; please get
> a newer Subversion client
>
>
> Then I find this page:
> http://mojo.codehaus.org/buildnumber-maven-plugin/using-svnjava.html
> and change the configuration
>
>                        <plugin>
>                                <groupId>org.codehaus.mojo</groupId>
>                                <artifactId>buildnumber-maven-plugin</artifactId>
>                                <version>1.0-beta-3</version>
>                                <executions>
>                                        <execution>
>                                                <phase>validate</phase>
>                                                <goals>
>                                                        <goal>create</goal>
>                                                </goals>
>                                        </execution>
>                                </executions>
>                                <configuration>
>                                        <doCheck>true</doCheck>
>                                        <doUpdate>true</doUpdate>
>                                        <providerImplementations>
>                                                <svn>javasvn</svn>
>                                        </providerImplementations>
>                                </configuration>
>                        </plugin>
>
> With this configuration I have this error:
>
> [INFO] [buildnumber:create {execution: default}]
> [INFO] Change the default 'svn' provider implementation to 'javasvn'.
> [INFO] Verifying there are no local modifications ...
> [INFO] SVN status directory: D:\Java\Eclipse-Workspaces\BizRules\PFW-SuperPOM
> [INFO] SVN update directory: D:\Java\Eclipse-Workspaces\BizRules\PFW-SuperPOM
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] org.apache.maven.scm.command.update.UpdateScmResult cannot be
> cast to org.apache.maven.scm.command.update.UpdateScmResultWithRevision
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.ClassCastException:
> org.apache.maven.scm.command.update.UpdateScmResult cannot be cast to
> org.apache.maven.scm.command.update.UpdateScmResultWithRevision
>        at org.codehaus.mojo.build.CreateMojo.update(CreateMojo.java:528)
>        at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:398)
>        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Thu Jul 02 17:47:15 BST 2009
> [INFO] Final Memory: 11M/21M
> [INFO] ------------------------------------------------------------------------
>
> Did I miss some configuration?
> Thank you for your help.
>
> Hélder Sousa
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email