Neil Hopcroft

A digital misfit


It turns out that it is not that difficult to convert a project to be built using Maven. Here are the steps I went through:

  1. Set up a repository – I’m using Artifactory
  2. Set permissions on the repository to allow a user to write to it
  3. Get the settings.xml file for Maven configuration
  4. Add the user authentication information to the downloaded settings file
  5. For each project in Eclipse
  6. Add a Maven nature
  7. Add the repository to the distributionManagement section of the generated pom.xml file
  8. Add a debug configuration for ‘Maven build…’
  9. Give a goal of ‘deploy’ and the path to the settings file from the repository
  10. Attempt a build and resolve any missing dependencies
  11. When the build is successful the output will be published to the repository

The two most complicated parts of this process were getting the user permissions right and resolving dependencies. The permissions is the usual dance of trying to use the right username and setting the correct permissions for all of the repositories, it is documented and fairly clear once you’ve got it all set up right. Atrifactory has an ‘access.log’ (which you can see in System Logs admin screen) which shows permission results, it is a good place to check if you are getting errors when deploying. During the setup phase I was building again with the same version number, which requires the ‘delete’ permission.

More interesting is resolving the dependencies, mostly searching Google for the package that reported an error gave a link on Maven Repository which contains an XML snippet to add the dependency information to the pom.xml file. I didn’t encounter any conflicts during this process as I was, for the most part, using versions already known to work but obtained from other sources. I’ll be writing a bit more about versions shortly, when I try to bring everything up to date.

Leave a Reply

Your email address will not be published.