Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven release:prepare fails with "scm connection or developerConnection must be specified"

I'm trying to prepare a release of my maven project with mvn release:prepare but it fails with the following error:

Caused by: org.apache.maven.plugin.MojoFailureException: Missing required setting: scm connection or developerConnection must be specified.

After reading about these settings on maven.apache.org, I see that there are SVN (Version Control) settings. But I'm not using version control. How should I make a maven release in this case?
I'm using maven 3.0.3.

like image 683
Henrique Ordine Avatar asked Apr 04 '13 07:04

Henrique Ordine


People also ask

What is SCM connection in POM XML?

Assuming that SCM has been configured in the pom. xml and the project directory is managed by a SCM, invoking the checkin goal in the scm will start the commit process for all configured sources in your pom. xml. The files should be added beforehand by an external scm client.

What is SCM release tag?

scm:tag will "only" perform a tag operation on the SCM system, where release:prepare will perform various tasks, included a tag operation on the SCM system. Sometimes you only want to perform the tag operation, without all the other things the release:prepare mojo does. – Tome.

What is SCM in maven?

Maven SCM supports Maven plugins (for example maven-release-plugin) and other tools by providing them with a common API for source code management operations. You can look at the list of SCMs for more information on using Maven SCM with your favorite SCM tool.

How does maven release plugin work?

The main aim of the maven-release plugin is to provide a standard mechanism to release project artifacts outside the immediate development team. The plugin provides basic functionality to create a release and to update the project's SCM accordingly.


2 Answers

If you only would like to change the version, the Versions Maven Plugin may help.

The versions:set may be the good one for using.

Please take a big note, since you're not using the SCM, please make a full backup before using the following command.

mvn versions:set -DnewVersion=1.0  mvn clean install mvn versions:set -DnewVersion=1.1-SNAPSHOT  mvn clean install 

Anyhow I highly recommend and encourage you to use the SCM and perform the release by following the Maven good practice instead.

I hope this may help.

like image 148
Charlee Chitsuk Avatar answered Sep 21 '22 17:09

Charlee Chitsuk


May your pom.xml not having the entry

    <scm>             <connection>scm:svn:https://host:port/abc/xyz/trunk</connection>  <developerConnection>scm:svn:https://host:port/abc/xyz/trunk</developerConnection>     </scm>  <build>         <pluginManagement>             <plugins>                 <plugin>                     <groupId>org.apache.maven.plugins</groupId>                     <artifactId>maven-release-plugin</artifactId>                     <version>2.5.2</version>                     <configuration>                         <tagBase>https://host:port/abc/xyz/tag</tagBase>                         <releaseProfiles>release</releaseProfiles>                     </configuration>                 </plugin>                            </plugins>         </pluginManagement>     </build>  
like image 31
Radhakrishnan Avatar answered Sep 22 '22 17:09

Radhakrishnan