Skip to content

Add local dependency

mkutmon edited this page Apr 23, 2013 · 6 revisions

Before adding a dependency make sure that it is not available in a Maven repository that could be accessed directly.

  1. Copy local jar into local repository directory
    cp dependency.jar cytoscape-wikipathways-app/localRepo/

  2. Add line in localsetup.sh file to install dependency locally
    mvn install:install-file -Dfile={path-to-app-directory}/cytoscape-wikipathways-app/localRepo/dependency.jar
    Then run the local setup script.
    ./localsetup.sh

  3. Open the pom.xml file to define the new dependency (cytoscape-wikipathways-app/wikipathways.app/pom.xml)

  4. Add new dependency in pom.xml file (within the dependencies tag) - groupId = org.pathvisio, artifactId = pathvisio-core, optional has to be true!

<dependency>
    <groupId>prefix</groupId>
    <artifactId>jar-name</artifactId>
    <version>version</version>
    <optional>true</optional>
</dependency>
  1. Add dependency to Maven shading plugin to make sure it is included in the resulting jar (search for maven-shade-plugin) - add include line to existing configuration artifact set.
<configuration>
    <artifactSet>
       <includes>
          **<include>prefix:jar-name</include>**
       </includes>
    </artifactSet>
</configuration>
  1. Run Maven install and check output
    mvn install -> [INFO] Including prefix:jar-name:version in the shaded jar.
Clone this wiki locally