Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven deploy jar to svn with a commit message

We use a maven repo managed in a SVN. I am built a jar newUtil-1.0.jar which I need to deploy it to the remote repo. I am using the following command, which results in build failure.

mvn deploy:deploy-file -Dfile=/tmp/newUtil-1.0.jar -DgroupId=com.tareque.utils -DartifactId=newUtil -Dversion=1.0 -Dpackaging=jar -DrepositoryId=myrepo -Durl=https://<my-repo-url>

Checking the logs at the server side for svn shows this message

[Fri Jan 18 11:35:47 2013] [error] [client 169.124.140.200] Commit blocked by pre-commit hook (exit code 1) with output: \nEmpty comments are not allowed.

by which it seems that commit's with empty messages/comments are blocked.

So, how do I pass a comment for the commit message to the above maven deploy command?

like image 430
mtk Avatar asked Dec 21 '25 02:12

mtk


1 Answers

Don't use deploy, use maven-release-plugin. Setting up the commit message in this case is easy:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <configuration>
        <scmCommentPrefix>re #123:</scmCommentPrefix>
      </configuration>
    </plugin>  ......

You'll have to search around a bit for whatever other settings you need to use the release plugin in the first place (<scm> and <distributionManagement> tags, for a start) but once you have mvn release:prepare release:perform working, this extra configuration setting will let you modify the commit message.

Trust me, once you use the release plugin properly you won't want to go back to hand-rolling releases.

ETA: if you are in fact trying to deploy snapshots to SVN (this seems kind of nuts and I've never seen it done, but it should be possible) you'd want to investigate using wagon-scm such that your <distributionManagement> section would use scm:svn:https://your-repo-url. If you get it working, please let us know!

like image 122
Coderer Avatar answered Dec 23 '25 07:12

Coderer