1

I am working on automating release process in my project from tagging to deployment. I am have created a java project for this, this will be a single place to integrate all stages from tagging, building jars to deployment.

Now for tagging and versioning purpose i want to use maven release plugin, but i can see that all maven commands have to be executed through command line which makes it difficult to check the result and output. One option which i feel can resolve this issue is if i can execute maven commands using some api [just like we have svnkit for subversion]. Although i can execute maven commands via commandline through java [Runtime.exec] but then again issue will be to check result and output.

Any suggestions on java library for maven? or any other way of doing the same thing? My basic aim is to control version of my project and tag the build.

EDIT:

Maven embedder is not supported any more : http://maven.40175.n5.nabble.com/Maven-Embedder-td4708683.html

EDIT:

I found a way out, hudson provides a maven release plugin and then i have developed a hudson java client. So i will be able to control maven release via parameters.

Lokesh
  • 7,810
  • 6
  • 48
  • 78
  • possible duplicate of [Embedding Maven 3](http://stackoverflow.com/questions/3333251/embedding-maven-3) – chrylis -cautiouslyoptimistic- Aug 09 '13 at 04:33
  • PLease coment with downvote. Whats wrong with this question? – Lokesh Aug 09 '13 at 04:34
  • @chrylis: That question is hardly having any info. Nobody even knows whats mavne embedder. I dont see this as any reason for downvoting. – Lokesh Aug 09 '13 at 04:38
  • Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Bart Aug 09 '13 at 05:33
  • @Bart: I have described my problem, isn't it? I want to control versioning and tagging my build and looking for a library to do the same. What else should i describe about the problem? – Lokesh Aug 09 '13 at 05:41
  • Why don't you use the maven-release-plugin in Maven? – khmarbaise Aug 09 '13 at 06:15
  • possible duplicate of [How to run maven from java?](http://stackoverflow.com/questions/5141788/how-to-run-maven-from-java) – Simon Verhoeven Aug 09 '13 at 06:26
  • @Simon: It's not, read the question "Although i can execute maven commands via commandline through java [Runtime.exec] but i want to avoid this and keep it as last measure." – Lokesh Aug 09 '13 at 06:41
  • Question has been reworded and now it fits the rules. – Lokesh Aug 11 '13 at 08:37

1 Answers1

2

There is already a solution in relationship with maven. This is the maven-release-plugin which exactly supports the given steps.

The prepare-goal of maven-release-plugin will exactly do things like checking if all changed have been committed and create a tag in svn.

So why would you like to execute it via Java? you could use Jenkins for such purposes or just the command line like:

mvn -B release:prepare release:perform

that's all.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • I am working to create a desktop client where users can perform a release in single click. Yes hudson plugin can help but a separate java api should be helpful but i feel there are none available. – Lokesh Aug 09 '13 at 06:23
  • 1
    Why do users need a desktop client, cause a release should never be created on users local machine. It has to be done only on a defined environment which usually is on a build server. – khmarbaise Aug 09 '13 at 06:25
  • I agree to your point, makes sense. – Lokesh Aug 09 '13 at 06:28