Skip to content

Latest commit

 

History

History
67 lines (40 loc) · 2.28 KB

DEV_NOTE3.md

File metadata and controls

67 lines (40 loc) · 2.28 KB

LPhy Developer Guide 103 (Maven project)

This tutorial explains some technical details about Maven project in IntelliJ.

Maven project

Here are two tutorials for importing a Maven project to IntelliJ :

Build

First, you need to understand a Build Lifecycle.

Test

When you want to reuse some classes in the unit tests in another project, such as utils, you create a jar containing test-classes.

https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html

Release

  1. Git pull, and then build and test. If there is no issues, go to the next step.

  2. Update the version in "pom.xml". If the project is also a BEAST2 package, e.g. LPhyBeast, you need to update the "version.xml" as well.

  3. Run the install command to create the release.

mvn clean install 

The release will be available under the build directory target.

mvn clean install -Dmaven.test.skip
  1. Find the jar or zip file in the corresponding target folder, and upload it to Github release.

Dependency management

Read Introduction to the Dependency Mechanism.

Dependency analysis tools

  1. Displays the dependency tree for this project. https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html
mvn dependency:tree -Dverbose
  1. Output a classpath string of dependencies from the local repository. https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html
mvn dependency:build-classpath

Useful Links