Skip to content

Editing Maven tips

Daniel Khashabi edited this page Sep 11, 2016 · 2 revisions

##Versioning Each tool (module) of the cogcomp-nlp project will inherit the same version number from the parent module.

Related to issue #6, we can use the following maven code to automatically augment the version for the parent and all components (including internal dependencies like core-utilities:

mvn versions:set -DnewVersion=X.Y.Z
mvn version:commit

If you made a mistake after versions:set, do

mvn versions:revert

Checking for new versions of Maven dependencies

If you need to make sure that your Maven dependencies are up to date, check out (the Versions Maven Plugin)[http://www.mojohaus.org/]. Calling the following command will display a list of dependencies with newer versions available:

mvn versions:display-dependency-updates Furthermore, you can use the versions:use-latest-versions or versions:use-latest-releases to automatically advance to the latest version of your updates (releases only searches for non-SNAPSHOT versions)

Setting the username and password for deployment

If you want the deployment script not to bother you next time you deploy, add the following options to the settings.xml:

  <servers>
    <server>
      <id>CogcompSoftware</id>
      <username>NETID</username>
      <password>PASSWORD</password>
    </server>
    <server>
      <id>CogcompSoftwareDoc</id>
      <username>NETID</username>
      <password>PASSWORD</password>
    </server>
  </servers>     

Temporary deploys

This is for deploying a maven project with a new version while changing the version name in all project modules for example to 1.0.3-SNAPSHOT. This is useful for testing the underlying maven projects such as lbjava which are not a module of our multi project but we often need to work on them/change them.

mvn versions:set -DnewVersion=1.0.3-SNAPSHOT
mvn install
Clone this wiki locally