maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sklar (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MRELEASE-511) release:prepare "Error parsing version, cannot determine next version: Unable to parse the version string" when running in batch mode.
Date Thu, 27 Jan 2011 16:56:06 GMT

    [ http://jira.codehaus.org/browse/MRELEASE-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=253203#action_253203
] 

David Sklar commented on MRELEASE-511:
--------------------------------------

FWIW, I am using the following ruby/expect script to run release:prepare to work around this
problem:

#!/usr/bin/env ruby

require 'pty'
require 'expect'
require 'rexml/document'


base_dir = "/path/to/my/project"
pom_file = base_dir + "/pom.xml"

raise "Can't read #{pom_file}" unless File.readable? pom_file

pom = REXML::Document.new(File.new(pom_file))

raise "Can't find project version in #{pom_file}" unless pom.elements['project/version']

version = pom.elements['project/version'].text

release_version = version.gsub(/-SNAPSHOT/,'')
scm_tag = "project-" + release_version

# Write a make_new_development_version() function appropriate to 
# whatever format you're using for your version strings
development_version = make_new_development_version(release_version)

# $expect_verbose = true
PTY.spawn("mvn -Dresume=false release:prepare") do |reader, writer, pid|
  reader.expect(/What is the release version for.+: :/)
  writer.puts(release_version)
  reader.expect(/What is SCM release tag or label for.+: :/)
  writer.puts(scm_tag)
  reader.expect(/What is the new development version for.+: :/)
  writer.puts(development_version)
  
  reader.each { |line| print line }
end


> release:prepare "Error parsing version, cannot determine next version: Unable to parse
the version string" when running in batch mode.
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-511
>                 URL: http://jira.codehaus.org/browse/MRELEASE-511
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-9
>         Environment: Win Xp Pro 64bit Java 1.6
>            Reporter: David Cloutier
>            Priority: Critical
>         Attachments: patch_release_version_patterns.txt
>
>
> When I try to run release:prepare in batch mode, I get the error below (can't parse version
string) even though I supply the version number by argument. If I do the same thing with the
same versions in interactive mode, it works fine.
> Here is the output:
> ------------------------------------------------------------------------
> C:\workspaces\head\MyClient>mvn -B -e -Dresume=false -Dtag=PPX -DdevelopmentVersion=MYB_200909-SNAPSHOT
-DreleaseVersion=PPX release:prepare release:perform
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Unnamed - com.mycie:MyClient:jar:MYB_200909-SNAPSHOT
> [INFO]    task-segment: [release:prepare, release:perform] (aggregator-style)
> [INFO] ------------------------------------------------------------------------
> Downloading: http://myrepo.int.mycie.com:8081/artifactory/repo/org/apache/ws/security/wss4j/1.5.3/wss4j-1.5.3.pom
> [INFO] Unable to find resource 'org.apache.ws.security:wss4j:pom:1.5.3' in repository
libs-releases (http://myrepo.int.mycie.com:8081/artifactory/repo)
> Downloading: http://myrepo.int.mycie.com/artifactory/libs-releases-local/org/apache/ws/security/wss4j/1.5.3/wss4j-1.5.3.pom
> [INFO] Unable to find resource 'org.apache.ws.security:wss4j:pom:1.5.3' in repository
libs-releases-local (http://myrepo.int.mycie.com/artifactory/libs-releases-local)
> Downloading: http://repo1.maven.org/maven2/org/apache/ws/security/wss4j/1.5.3/wss4j-1.5.3.pom
> [INFO] Unable to find resource 'org.apache.ws.security:wss4j:pom:1.5.3' in repository
central (http://repo1.maven.org/maven2)
> [INFO] [release:prepare {execution: default-cli}]
> [INFO] Verifying that there are no local modifications...
> [INFO] Executing: cmd.exe /X /C "cvs -z3 -f -t -d :pserver:usrbuild@mycvshost:/data/cvs/libcvs_web
-n -q update -d"
> [INFO] Working directory: C:\workspaces\head\MyClient
> [INFO] Checking dependencies and plugins for snapshots ...
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error parsing version, cannot determine next version: Unable to parse the version
string: "MYB_200909-SNAPSHOT"
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error parsing version, cannot
determine next version: Unable to parse the version string: "MYB_200909-SNAPSHOT"
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
>         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:362)
>         at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
>         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)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error parsing version, cannot
determine next version: Unable to parse the version string: "MYB_200909-SNAPSHOT"
>         at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:186)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         ... 17 more
> Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Error parsing version,
cannot determine next version: Unable to parse the version string: "MYB_200909-SNAPSHOT"
>         at org.apache.maven.shared.release.phase.MapVersionsPhase.getNextVersion(MapVersionsPhase.java:227)
>         at org.apache.maven.shared.release.phase.MapVersionsPhase.execute(MapVersionsPhase.java:140)
>         at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:196)
>         at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:133)
>         at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:96)
>         at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:182)
>         ... 19 more
> Caused by: org.apache.maven.shared.release.versions.VersionParseException: Unable to
parse the version string: "MYB_200909-SNAPSHOT"
>         at org.apache.maven.shared.release.versions.DefaultVersionInfo.<init>(DefaultVersionInfo.java:171)
>         at org.apache.maven.shared.release.phase.MapVersionsPhase.getNextVersion(MapVersionsPhase.java:177)
>         ... 24 more
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 4 seconds
> [INFO] Finished at: Wed Jan 06 16:10:47 EST 2010
> [INFO] Final Memory: 9M/18M
> [INFO] ------------------------------------------------------------------------

-- 
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

        

Mime
View raw message