42

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.

JJD
  • 50,076
  • 60
  • 203
  • 339
Henrique Ordine
  • 3,337
  • 4
  • 44
  • 70
  • 2
    Don't you use any version control? I wonder how a release management can work without one. – Bevor Apr 04 '13 at 07:17
  • 1
    What are you trying to do specifically. What does a 'release' mean to you? There might be better ways to achieve what you want without using the release plugin. – Simon Hellinger Apr 04 '13 at 07:28
  • I want my maven project to go from 1.0-SNAPSHOT to 1.1-SNAPSHOT, and that maven generates the jar for my 1.0 version. – Henrique Ordine Apr 04 '13 at 07:35
  • possible duplicate of [Updating version numbers of modules in a multi-module Maven project](http://stackoverflow.com/questions/5726291/updating-version-numbers-of-modules-in-a-multi-module-maven-project) – Danubian Sailor Mar 25 '14 at 12:17
  • i am using GIT for version control still i do see this error. – vivex Jun 20 '16 at 05:56

4 Answers4

50

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.

akokskis
  • 1,486
  • 15
  • 32
Charlee Chitsuk
  • 8,847
  • 2
  • 56
  • 71
16

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> 
Radhakrishnan
  • 564
  • 4
  • 6
4

You need to add your SCM configuration. In the example below I added my git repository to the master branch

<scm>
    <developerConnection>
        scm:git:git@github.com:tufac2/sfg-pet-clinic.git
    </developerConnection>
</scm>
tufac2
  • 668
  • 6
  • 7
0

In Springboot the answer depends of plugin that you are using

docker-maven-plugin:

  • mvn docker:build

dockerfile-maven-plugin:

  • mvn dockerfile:build

I hope this help you

Regards