Jakub Skoczen created MBUILDNUM-92:
--------------------------------------

             Summary: Git buildId fails when Maven is invoked from another 
process (e.g NetBeans or packaging scripts)
                 Key: MBUILDNUM-92
                 URL: https://jira.codehaus.org/browse/MBUILDNUM-92
             Project: Mojo Build Number Maven Plugin
          Issue Type: Bug
    Affects Versions: 1.1
         Environment: RHEL 5.5, OSX 10.6.8
            Reporter: Jakub Skoczen


Git is present on the path and standard 'mvn buildnumber:create" works, but 
invoking the goal from within IDE/Makefile/RPM scripts fails with: 


[DEBUG] Configuring mojo 
'org.codehaus.mojo:buildnumber-maven-plugin:1.0:create' -->
[DEBUG]   (s) buildNumberPropertiesFileLocation = 
/home/jakub/rpmbuild/BUILD/masterkey-torus2-2.9/buildNumber.properties
[DEBUG]   (f) buildNumberPropertyName = buildNumber
[DEBUG]   (s) doCheck = false
[DEBUG]   (s) doUpdate = false
[DEBUG]   (f) getRevisionOnlyOnce = false
[DEBUG]   (f) project = MavenProject: com.indexdata:torus:2.10-SNAPSHOT @ 
/home/jakub/rpmbuild/BUILD/masterkey-torus2-2.9/pom.xml
[DEBUG]   (f) reactorProjects = [MavenProject: 
com.indexdata:torus:2.10-SNAPSHOT @ 
/home/jakub/rpmbuild/BUILD/masterkey-torus2-2.9/pom.xml]
[DEBUG]   (f) readUrlScm = 
scm:git:ssh://git.indexdata.com:222/home/git/private/torus
[DEBUG]   (f) scmBranchPropertyName = scmBranch
[DEBUG]   (s) scmDirectory = /home/jakub/rpmbuild/BUILD/masterkey-torus2-2.9
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@5893bca2
[DEBUG]   (f) timestampPropertyName = timestamp
[DEBUG]   (f) useLastCommittedRevision = false
[DEBUG] -- end configuration --
[INFO] [buildnumber:create {execution: default}]
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] Executing: /bin/sh -c cd /home/jakub/rpmbuild/BUILD/masterkey-torus2-2.9 
&& git show
[INFO] Working directory: /home/jakub/rpmbuild/BUILD/masterkey-torus2-2.9
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot get the revision information from the scm repository : 
Exception while executing SCM command.

[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot get the revision 
information from the scm repository : 
Exception while executing SCM command.
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot get the 
revision information from the scm repository : 
Exception while executing SCM command.
        at org.codehaus.mojo.build.CreateMojo.getRevision(CreateMojo.java:727)
        at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:443)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by: org.apache.maven.scm.ScmException: Exception while executing SCM 
command.
        at 
org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:63)
        at 
org.apache.maven.scm.provider.git.AbstractGitScmProvider.executeCommand(AbstractGitScmProvider.java:290)
        at 
org.apache.maven.scm.provider.git.AbstractGitScmProvider.info(AbstractGitScmProvider.java:311)
        at org.codehaus.mojo.build.CreateMojo.info(CreateMojo.java:747)
        at org.codehaus.mojo.build.CreateMojo.getRevision(CreateMojo.java:694)
        ... 20 more
Caused by: java.lang.UnsupportedOperationException
        at 
org.apache.maven.scm.provider.git.gitexe.command.info.GitInfoCommand.executeCommand(GitInfoCommand.java:56)
        at 
org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
        ... 24 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Mar 14 09:37:35 UTC 2012
[INFO] Final Memory: 19M/176M
[INFO] ------------------------------------------------------------------------


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email


Reply via email to