svn - continuous integration based on maven2 -
I am trying to find out how to set up continuous integration using Maven.
What do I need:
- Check new things in SVN
- If the changes have been detected, then check them
- create and deploy
I think that all this can be pushed into shell script by Kron to implement it. In this way, we will make continuous integration (automatically build the night, for example)
I know that Maven has the SCM plugin to work with version control systems, but I do not know Depending on how this can check the changes in the repository and launch the results based on checkout.
So I am asking the audience :)
PS I forget to tell - I am not interested in any existing application! They are too heavy for my VPS server. Please do not advise them.
I Recommend a recognized experiment because CIs are just comparable to construction.
But if you are determined to roll your own, then you can use some goals with Maven-scm-plugin and capture output.
This is a local copy of the project so that you can reach POM, you can run the status command to check the changes, and you can parse the output check of any change, the goal of using it :
MVN CCM: Status
If you see any changed files, you can see the changes and open your own build . Although be careful, there is a bug in Maven-scm-provider-svn which means that the changed files can be omitted! You can use subversion better and you can parse its output. For example, any previous build will be cleared in the following, check any changed content and then run the deployment target.
MVN Clean CKM: Deploy Checkout
If you do not have a working copy of the project, then you can use the target to get it Are there. If you set up some properties in Palm, you can reuse many projects for pods for bootstrap. For example, if you pass arguments to the appropriate command line, then you can boot any of the following projects:
mvn scm: bootstrap -DscmUserName = me -DscmPassword = Mypass -DscmConnectionUrl = scm: svn: http: // myserver / myproject / trunk & lt; Project & gt; [...] & lt; Packaging & gt; Jar & lt; / Packaging & gt; & Lt; Version & gt; 0.0.1 & lt; / Edition & gt; & Lt; Name & gt; SCM bootstrap & lt; / Name & gt; & Lt; URL & gt; Http: //somecompany.com< / URL & gt; & Lt; SCM & gt; & Lt; Connection & gt; $ {ScmConnectionUrl} & lt; / Connection & gt; & Lt; DeveloperConnection & gt; $ {ScmDeveloperConnectionUrl} & lt; / DeveloperConnection & gt; & Lt; URL & gt; $ {ScmUrl} & lt; / URL & gt; & Lt; SCM & gt; [...] & lt; Build & gt; [...] & lt; Plugins & gt; & Lt; Plugin & gt; & Lt; Group & gt; Org.apache.maven.plugins & lt; / Group & gt; & Lt; ArtifactId & gt; Maven-SCM-plugin & lt; / ArtifactId> & Lt; Version & gt; 1.0 & lt; / Edition & gt; & Lt; Configuration & gt; & Lt; Goals & gt; Install & lt; / Targets & gt; & Lt; Username & gt; $ {ScmUsername} & lt; / Username & gt; & Lt; Password & gt; $ {ScmPassword} & lt; / Password & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt; & Lt; / Plugins & gt; [...] & lt; / Build> [...] & lt; Properties & gt; & Lt; ScmDeveloperConnectionUrl & gt; Dummy & lt; / ScmDeveloperConnectionUrl & gt; & Lt; ScmConnectionUrl & gt; Dummy & lt; / ScmConnectionUrl & gt; & Lt; ScmUrl & gt; Dummy & lt; / ScmUrl & gt; & Lt; ScmUsername & gt; Dummy & lt; / ScmUsername & gt; & Lt; ScmPassword & gt; Dummy & lt; / ScmPassword & gt; & Lt; / Properties & gt; & Lt; / Project & gt;
To work Maven with subversion you need to configure the scm section of POM:
& lt ; Scm & gt; & Lt; Connection & gt; SCM: SVN: http: // path / to / project & lt; / Connection & gt; & Lt; DeveloperConnection & gt; SCM: SVN: http: // path / to / project / tag / version & lt; / DeveloperConnection & gt; & Lt; URL & gt; SCM: SVN: http: // path / to / project / tag / version & lt; / URL & gt; & Lt; / SCM & gt;
As an alternative to voting for changes, consider adding an addendum that when a change is made then the construction begins. By doing so, you give an indicator You can.
Comments
Post a Comment