r2 - 09 Jun 2006 - 08:51:00 - DavidWithersYou are here: myGrid wiki >  Mygrid Web  > AddingMavenModules

How to add a module to the Taverna build

  • Create a pom for the module
  • Add the module to the parent pom
  • Check for conflicting dependencies

Creating the module pom

The pom must include a reference the parent pom, the module's artifact ID and any dependencies. The module's pom will inherit properties from the parent - to find out what the combined pom will be use:

mvn help:effective-pom

The module will inherit the version from the parent if the module does not specify its own version.

Example module pom


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <parent>
    <groupId>uk.org.mygrid</groupId>
    <artifactId>taverna</artifactId>
    <version>1.3-SNAPSHOT</version>
    <relativePath>../parent-pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>taverna-contrib</artifactId>
  <packaging>jar</packaging>
  <name>Taverna contrib</name>
  <dependencies>
    <dependency>
      <groupId>uk.org.mygrid</groupId>
      <artifactId>taverna-workbench</artifactId>
    </dependency>
    <dependency>
      <groupId>jaxen</groupId>
      <artifactId>jaxen</artifactId>
      <version>1.0-FCS</version>
    </dependency>
  </dependencies>
</project>

Adding the module to the parent pom

Add the the module to the modules section of the parent pom. The module specifies a path to the module; maven will look for a pom.xml file at that location.


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>uk.org.mygrid</groupId>
  <artifactId>taverna</artifactId>
  <version>1.3-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>Taverna</name>
  <modules>
    <module>.</module>
    <module>contrib</module>
    <module>launcher</module>
  </modules>
  .
  .
  .
</project>

Checking module dependencies

Running maven with the -X flag will show how maven decides what version of dependencies to use

mvn -X compile


[DEBUG]   dom4j:dom4j:jar:1.5:compile (selected for compile)
[DEBUG]     jaxme:jaxme-api:jar:0.3:compile (selected for compile)
[DEBUG]     xml-apis:xml-apis:jar:1.0.b2:compile (selected for compile)
[DEBUG]     msv:xsdlib:jar:20030807:compile (selected for compile)
[DEBUG]     dom4j:dom4j:jar:1.5.2:compile (removed - causes a cycle in the graph)
[DEBUG]     jaxen:jaxen:jar:1.1-beta-4:compile (selected for compile)
[DEBUG]     msv:relaxngDatatype:jar:20030807:compile (selected for compile)
[DEBUG]   poi:poi-2.0-final:jar:20040126:compile (selected for compile)
[DEBUG]   mygrid:axis:jar:1.4-taverna:system (selected for system)
[DEBUG]   axis:axis-jaxrpc:jar:1.3:compile (selected for compile)
[DEBUG]   xerces:xercesImpl:jar:2.5.0:compile (removed - nearer found: 2.6.2)
[DEBUG]   xerces:xercesImpl:jar:2.6.2:compile (selected for compile)
[DEBUG]   mygrid:jakarta-oro:jar:2.0.5:system (selected for system)
[DEBUG]   mysql:mysql-connector-java:jar:3.0.10:compile (selected for compile)
[DEBUG]   mygrid:jgraph:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:freefluo-taverna-exts:jar:NO-VERSION:system (selected for system)
[DEBUG]   batik:batik-ext:jar:1.6:compile (selected for compile)
[DEBUG]   mygrid:Jmol:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:jstyx:jar:0.03:system (selected for system)
[DEBUG]   mygrid:notification-processor:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:ensj-util:jar:NO-VERSION:system (selected for system)
[DEBUG]   axis:axis-schema:jar:1.3:compile (selected for compile)
[DEBUG]   mygrid:jena:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:freefluo:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:lsid-client:jar:1.1:system (selected for system)
[DEBUG]   mygrid:alltools2:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:talisman:jar:1.4.5.11:system (selected for system)
[DEBUG]   javax.servlet:servlet-api:jar:2.4-20040521:compile (selected for compile)
[DEBUG]   wsdl4j:wsdl4j:jar:1.5.1:compile (selected for compile)
[DEBUG]   concurrent:concurrent:jar:1.3.4:compile (selected for compile)
[DEBUG]   log4j:log4j:jar:1.2.8:compile (selected for compile)
[DEBUG]   mygrid:jfunc:jar:1.1:system (selected for system)
[DEBUG]   commons-discovery:commons-discovery:jar:0.2:compile (selected for compile)
[DEBUG]     commons-logging:commons-logging:jar:1.0.3:compile (removed - nearer found: 1.0.4)
[DEBUG]   batik:batik-gui-util:jar:1.6:compile (selected for compile)
[DEBUG]   batik:batik-extension:jar:1.6:compile (selected for compile)
[DEBUG]   junit:junit:jar:3.8:compile (selected for compile)
[DEBUG]   mygrid:jmoby:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:jedit-syntax:jar:2.2.2:system (selected for system)
[DEBUG]   jdom:jdom:jar:1.0:compile (selected for compile)
[DEBUG]   commons-codec:commons-codec:jar:1.2:compile (selected for compile)
[DEBUG]   commons-cli:commons-cli:jar:1.0:compile (selected for compile)
[DEBUG]     commons-logging:commons-logging:jar:1.0:compile (removed - nearer found: 1.0.4)
[DEBUG]     commons-lang:commons-lang:jar:1.0:compile (selected for compile)
[DEBUG]       junit:junit:jar:3.7:compile (removed - nearer found: 3.8)
[DEBUG]   bsh:bsh:jar:2.0b1:compile (selected for compile)
[DEBUG]   batik:batik-swing:jar:1.6:compile (selected for compile)
[DEBUG]   mygrid:jcalendar:jar:2.0.5:system (selected for system)
[DEBUG]   mygrid:icu4j:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:jcfe:jar:1.1.200108201911:system (selected for system)
[DEBUG]   mygrid:antlr:jar:NO-VERSION:system (selected for system)
[DEBUG]   mygrid:mail:jar:NO-VERSION:system (selected for system)
[DEBUG]   com.sun:tools:jar:1.4.2:system (selected for system)
[DEBUG]   org.biomart:martservice:jar:0.4:system (selected for system)
[DEBUG]   batik:batik-svggen:jar:1.6:compile (selected for compile)
[DEBUG]   commons-httpclient:commons-httpclient:jar:3.0-rc4:compile (selected for compile)
[DEBUG]     commons-logging:commons-logging:jar:1.0.3:compile (removed - nearer found: 1.0.4)
[DEBUG]     junit:junit:jar:3.8.1:compile (removed - nearer found: 3.8)
[DEBUG]   mygrid:tl-netty2:jar:1.7.3:system (selected for system)

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by myGrid wiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding myGrid wiki? Send feedback