Running mvn scm:status or release:prepare fails with RTC 4.x: "Error code for Jazz SCM status command - 54" - maven

Both of these plugins fail the same way, which makes sense as the release plugin calls scm:status to ensure that there are no local modifications.
Here's the normal (short) error from running mvn release:prepare:
$ mvn -DworkingDirectory=/tmp/maven release:prepare release:perform
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bar 2.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.5:prepare (default-cli) # bar ---
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: **/pom.xml.backup, **/release.properties, **/pom.xml.branch, **/pom.xml.next, **/pom.xml.releaseBackup, **/pom.xml.tag
[INFO] Executing: /bin/sh -c cd /home/davisk/workspaces/foo/bar && scm status --username johndoe#us.ibm.com --password '*****'
[INFO] Working directory: /home/davisk/workspaces/foo/bar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.954 s
[INFO] Finished at: 2014-07-23T03:12:04-05:00
[INFO] Final Memory: 15M/481M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project bar: Unable to check for local modi
fications
[ERROR] Provider message:
[ERROR] Error code for Jazz SCM status command - 54
[ERROR] Command output:
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Running mvn scm:status -X, I can get the full underlying error message (trimmed):
[DEBUG] Consumed line :Workspace: (1023) "bar" (This workspace is unreachable.)
[DEBUG] Consumed line : Could not determine the URI required to connect to the repository. The UUID of
[DEBUG] Consumed line : the repository is _t2J8kWECEeKBH6O9T2VOlA. If you know the repository URI run
[DEBUG] Consumed line : 'login' command providing the repository URI. If not, please contact your
[DEBUG] Consumed line : administrator.
Need to get this resolved.

From some research, it sounds like Maven's RTC/Jazz SCM provider may have been built against the RTC 3.0 command line interface.
Fortunately, there seems to be a perfectly usable workaround: login via RTC's scm login command line tool ahead of time:
$ scm login --repository-uri https://fizz.example.com:9443/ccm --username johndoe#us.ibm.com
Password (johndoe#us.ibm.com # https://fizz.example.com:9443/ccm):
Logged in to https://fizz.example.com:9443/ccm
After running this once, it seems the login is cached somewhere, and the mvn scm:status call then works as expected.

Related

Jenkins Maven integration failed

I am trying to integrate Jenkins with Maven. Through terminal I am able to execute the Maven command (clean install). But from Jenkins it fails.
Getting following error:
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building BrowserStackDemo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # BrowserStackDemo ---
[INFO] Deleting /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.090 s
[INFO] Finished at: 2018-02-04T16:17:27+01:00
[INFO] Final Memory: 11M/190M
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project BrowserStackDemo:** Failed to clean project: Failed to delete /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target/.DS_Store -> [Help 1]
[ERROR]
[JENKINS] Archiving /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml to BrowserStack/BrowserStackDemo/0.0.1-SNAPSHOT/BrowserStackDemo-0.0.1-SNAPSHOT.pom
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
/Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml is not inside /Users/Shared/Jenkins/Home/workspace/MavenJenkinsIntegration1/Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/; will archive in a separate pass
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
channel stopped
Finished: FAILURE
Note:
I am not using any server like Tomcat. My problem is not able to delete the target folder from Jenkins, when ever I taken a clean build, target folder will create newly, so I am unable to give the access for the target folder.
Your Jenkins executor is unable to delete the target folder of project . The error statements points it out clearly.
*[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project BrowserStackDemo:** Failed to clean project: Failed to delete /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target/.DS_Store -> [Help 1]
Such error occurs when the access to file is denied at the OS filesystem level OR the target folder's files are already being used somewhere in some other process and they are left in OPEN state. Try deleting the target folder manually.

Jenkins svn branches

I recently created an automated process to run multi-step Maven builds for my organization. But i am having difficulty committing the version changes on svn
I want to update this file contents and compile my code and then commit this file back to svn. So that SVN has latest build version number.
How do I commit this changed file to SVN.
Ty very much.
I invoke top-level Maven targets to release in svn:
my goals is: release:perform -DconnectionUrl=scm:svn:http://XXX
This is my maven error in jenkins:
[maven] $ cmd.exe /C "D:\apache-maven-3.5.0\bin\mvn.cmd release:perform -DconnectionUrl=scm:svn:http://10.10.20.151/svn/repos/aubay/test/jenkins/branches && exit %%ERRORLEVEL%%"
channel stopped
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jenkins 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.3.2:perform (default-cli) # jenkins ---
[ERROR] Cannot perform release - the preparation step was stopped mid-way. Please re-run release:prepare to continue, or perform the release from an SCM tag.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.199 s
[INFO] Finished at: 2017-08-24T15:48:29+02:00
[INFO] Final Memory: 12M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:perform (default-cli) on project jenkins: Cannot perform release - the preparation step was stopped mid-way. Please re-run release:prepare to continue, or perform the release from an SCM tag. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

Apache Quickstart not working: "The defined artifact is not an archetype"

I'm trying to get started with the basic Flink quickstart examples.
https://ci.apache.org/projects/flink/flink-docs-release-1.2/quickstart/java_api_quickstart.html
I'm getting an error at the very first step with Maven. Regardless of whether I try to install using Maven or the "curl" command, I get the same error "The defined artifact is not an archetype":
Command:
mvn archetype:generate \
> -DarchetypeGroupId=org.apache.flink \
> -DarchetypeArtifactId=flink-quickstart-java \
> -DarchetypeVersion=1.2.0
Response:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [org.apache.flink:flink-quickstart-java:1.2.1] found in catalog remote
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.916 s
[INFO] Finished at: 2017-05-03T18:16:55+02:00
[INFO] Final Memory: 18M/280M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The defined artifact is not an archetype -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I'm very confused as I was able to execute these quickstarts last week without problem, and I'm completely new to Maven/Flink so I'm having trouble pinpointing what could have changed since then. Any ideas?
Only defining the archetype is not enough. You also need to provide details for the current maven project itself.
Either you have to pass the 'groupId', 'artifactId' and 'version' in the interactive mode when you run the above mentioned command.
Or, you can use the following command mvn archetype:generate -DarchetypeGroupId=org.apache.flink -DarchetypeArtifactId=flink-quickstart-java -DarchetypeVersion=1.2.0 -DgroupId=com.example -DartifactId=flink -Dversion=0.1
I have encountered with a similar error while I was trying to generate the "graphwalker" archetype using below command.
mvn archetype:generate -B \
-DarchetypeGroupId=org.graphwalker \
-DarchetypeArtifactId=graphwalker-maven-archetype \
-DgroupId=com.company -DartifactId=myProject \
-DarchetypeVersion=LATEST
However, my clue was I could generate it in the first time, but the second time it threw a similar error.
I was able to solve it by removing ./m2/repository and generating the archetype again.
rm -rf ./m2/repository

Building SonarQube with maven and batch_boostrap/index cannot be found

I'm running mvn sonar:sonar in the directory of the project I'm running. I already have my pom.xml updated:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.7.1</version>
</plugin>
After running sudo mvn sonar:sonar (I am on ubuntu 14.04) in my terminal, I get the following error:
eschwartz#LATITUDE:~/ideaprojects/xQueryEngine$ sudo mvn sonar:sonar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xQueryEngine (Solr 4 REX) 1.11.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.7.1:sonar (default-cli) # xqe ---
[INFO] User cache: /root/.sonar/cache
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.854s
[INFO] Finished at: Wed Feb 17 15:56:59 EST 2016
[INFO] Final Memory: 17M/302M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project xqe: Fail to download libraries from server: Status returned by url : 'http://localhost:9000/batch_bootstrap/index' is invalid : 404 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Anyone know how to fix this?
Thanks.
You have to set sonar.host.url=http://localhost:9000/sonar. You can do this by passing -Dsonar.host.url=... to mvn, or ideally set it in your Maven Global/Project Settings so that you don't always have to pass it as a command line argument.
Details: if your dashboard is at localhost:9000/sonar then it means you're using sonar.web.context=/sonar , which is different from the default (/). So you need to tell the scanner where to find SonarQube.

maven error BUILD FAILURE

I am following a maven tutorial. I am trying to execute this command which is my 1st maven command. Tutorial says it will crate a directory named my-app, but it didn't. This is command & its output,
command:
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
output:
C:\Users\Babar>mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=m
y-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) # standalone-pom >>
>
[INFO]
[INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) # standalone-pom <<
<
[INFO]
[INFO] --- maven-archetype-plugin:2.1:generate (default-cli) # standalone-pom --
-
[INFO] Generating project in Batch mode
[INFO] -------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Old (1.x) Archetype:
maven-archetype-quickstart:1.0
[INFO] -------------------------------------------------------------------------
---
[INFO] Parameter: groupId, Value: com.mycompany.app
[INFO] Parameter: packageName, Value: com.mycompany.app
[INFO] Parameter: package, Value: com.mycompany.app
[INFO] Parameter: artifactId, Value: my-app
[INFO] Parameter: basedir, Value: C:\Users\Babar
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.971s
[INFO] Finished at: Fri Nov 18 00:07:12 EET 2011
[INFO] Final Memory: 6M/11M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.1:generate (default-cli) on project standalone-pom: Directory my-app already ex
ists - please run from a clean directory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
'cmd' is not recognized as an internal or external command,
operable program or batch file.
error msg says directory already exists but it's not. I execute this command more than oncw
EDIT
command(suggested in answer)
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archet
ypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=5-SNAPS
HOT
OUTPUT
C:\Users\Babar>mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archet
ypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=5-SNAPS
HOT
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) # standalone-pom >>
>
[INFO]
[INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) # standalone-pom <<
<
[INFO]
[INFO] --- maven-archetype-plugin:2.1:generate (default-cli) # standalone-pom --
-
[INFO] Generating project in Interactive mode
[INFO] Archetype repository missing. Using the one from [org.apache.maven.archet
ypes:maven-archetype-quickstart:1.1] found in catalog remote
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.552s
[INFO] Finished at: Fri Nov 18 01:09:15 EET 2011
[INFO] Final Memory: 6M/12M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.1:generate (default-cli) on project standalone-pom: The desired archetype does
not exist (org.apache.maven.archetypes:maven-archetype-quickstart:5-SNAPSHOT) ->
[Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
'cmd' is not recognized as an internal or external command,
operable program or batch file.
Close your eclipse
Delete the .m2 folder which shows the server connnection
Re-run your eclipse.
Try this one, it works for maven 3-3-9 for win7 32bit
mvn archetype:generate -DgroupId="com.mycompany.app" -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Try this :
mvn archetype:generate -DgroupId="com.mycompany.app" -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Your sentences have been modified -DgroupId="com.mycompany.app". You need to use double quotes.
I´ve worked on windows 8 and it works. I don´t know if it happens on Linux.
I faced the same issue, and I resolved by run the commond(MVN Clean) from inside the folder where pom.xml located. Please follow below steps:
Open Eclipse
Open your Maven project.
Right Click on pom.xml
Click on properties
5.Copy pom.xml location URL
Open cmd
Write and paste the pom.xml location in the cmd until before /pom.xml as below,
cd C:\Users\X\eclipse-workspace\Your project Name
Hit Enter.
Run mvn clean commond again.
You will note that the original error said
Directory my-app already exists - please run from a clean directory
Did you possibly run that command from a directory where there is already a Maven project (one with a pom.xml file)? If so please start with a clean location.
When I ran the command you used verbatim on an empty directory, it ran without error and created a directory called my-app.
This line is of concern:
[INFO] Using following parameters for creating project from Old (1.x)
Archetype: maven-archetype-quickstart:1.0
Looking at the maven docs page at http://maven.apache.org/archetype/maven-archetype-bundles/maven-archetype-quickstart/, i see that the command you should be using is:
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=5-SNAPSHOT
Which is not exactly what you are running (you are missing the -DarchetypeVersion=5-SNAPSHOT part).

Resources