Difference between revisions of "Stardust/Knowledge Base/Build and Change Management/Maven/Basic Setup"

From Eclipsepedia

Jump to: navigation, search
(Example Usage)
Line 47: Line 47:
 
<br>  
 
<br>  
  
Other helpfull repositories could be ibiblio [http://www.ibiblio.org/maven http://www.ibiblio.org/maven] or the Nuxeo Apache repository [http://maven.nuxeo.org/nexus/content/groups/public http://maven.nuxeo.org/nexus/content/groups/public].<br>
+
Other helpfull repositories could be ibiblio [http://www.ibiblio.org/maven http://www.ibiblio.org/maven] or the Nuxeo Apache repository [http://maven.nuxeo.org/nexus/content/groups/public http://maven.nuxeo.org/nexus/content/groups/public].<br>  
  
 
== Maven Archetype  ==
 
== Maven Archetype  ==
Line 63: Line 63:
 
*'''Console''' command line tool client environment project, '''Spring '''client, '''artefactId=ipp-archetype-console-spring-client'''<br>  
 
*'''Console''' command line tool client environment project, '''Spring '''client, '''artefactId=ipp-archetype-console-spring-client'''<br>  
 
*'''Sysconsole '''command lient tool client environment project (direct database access via JDBC), '''artefactId=ipp-archetype-sysconsole-client'''<br>
 
*'''Sysconsole '''command lient tool client environment project (direct database access via JDBC), '''artefactId=ipp-archetype-sysconsole-client'''<br>
 +
 +
<br>
  
 
For other application servers the example project coming closest to the target deployment can be adjusted. Additional archetypes for other deployment scenarios will be added soon.<br>  
 
For other application servers the example project coming closest to the target deployment can be adjusted. Additional archetypes for other deployment scenarios will be added soon.<br>  
  
It is important to execute the goal '''''dependency:unpack'''''&nbsp; after the project has been created. This can be automated by using the '''''-Dgoals''''' parameter when the project is created.<br>  
+
*The repository ipp-community-releases already contains a beta version of the '''Weblogic Spring WAR''' archetype. Due to the WLS license restrictions this archetype requires the property ''wlfullclient.dir'' to be supplied as a parameter. The value should be the WLS folder in which the JAR wlfullclient.jar can be found.<br>
 +
 
 +
<br>
 +
 
 +
The goals ''''dependency:unpack'''' (for runtimes) / ''''generate-resources'''' (for console and sysconsole) have to be executed after the corresponding projects have been successfully created. However, project creation and goal execution can be combined in one by appending a ''-Dgoals'' parameter as shown in the examples below.<br>  
  
 
==== Example Usage  ====
 
==== Example Usage  ====
Line 72: Line 78:
 
If the repository is not configured in your settings.xml then you have to supply the repository URL as an additional parameter to the mvn command:  
 
If the repository is not configured in your settings.xml then you have to supply the repository URL as an additional parameter to the mvn command:  
 
<pre>-DarchetypeRepository=https://infinity.sungard.com/repository/ipp-libs</pre>  
 
<pre>-DarchetypeRepository=https://infinity.sungard.com/repository/ipp-libs</pre>  
The goals ''dependency:unpack'' (for runtimes) / ''generate-resources'' (for console and sysconsole) have to be executed after the projects have been successfully created. However, project creation and goal eecution can be combined in one command as show in the examples below.
 
 
 
'''Runtime'''  
 
'''Runtime'''  
 
<pre>mvn archetype:generate  
 
<pre>mvn archetype:generate  
Line 85: Line 89:
 
-DarchetypeVersion=6.0.3 -DgroupId=org.eclipse.stardust.test -DartifactId=stardust-console -Dversion=1.0-SNAPSHOT
 
-DarchetypeVersion=6.0.3 -DgroupId=org.eclipse.stardust.test -DartifactId=stardust-console -Dversion=1.0-SNAPSHOT
 
-Dgoals=generate-resources
 
-Dgoals=generate-resources
</pre>
+
</pre>  
 
+
 
== M2 Eclipse Plugin  ==
 
== M2 Eclipse Plugin  ==
  
The Maven Eclipse plugin is extremely helpful when working with maven projects under eclipse. It <br>
+
The Maven Eclipse plugin is extremely helpful when working with maven projects under eclipse. It <br>  
  
*allows you to create and import Maven projects
+
*allows you to create and import Maven projects  
*includes a form-based POM Editor
+
*includes a form-based POM Editor  
*manages dependencies and integrates them with the Eclipse classpath
+
*manages dependencies and integrates them with the Eclipse classpath  
*automatically downloads and updates dependencies
+
*automatically downloads and updates dependencies  
*resolves artifact Javadoc and source<br>
+
*resolves artifact Javadoc and source<br>  
*creates projects based on Maven archetypes
+
*creates projects based on Maven archetypes  
*supports browsing and searching of remote and local Maven repositories
+
*supports browsing and searching of remote and local Maven repositories  
*manages POMs with automatic updates to the dependency list<br>
+
*manages POMs with automatic updates to the dependency list<br>  
*adapts nested multi-module Maven projects to the Eclipse IDE
+
*adapts nested multi-module Maven projects to the Eclipse IDE  
*provides integration with the Web Tools Project (WTP)
+
*provides integration with the Web Tools Project (WTP)  
*integrates with Subclipse and Mylyn<br>
+
*integrates with Subclipse and Mylyn<br>  
*generates graphical displays of the dependency graph<br>
+
*generates graphical displays of the dependency graph<br>  
*allows to run maven goals from the IDE
+
*allows to run maven goals from the IDE  
 
*...
 
*...
  
 
You can learn more about the plugin here:&nbsp;[http://www.sonatype.com/books/m2eclipse-book/reference/ http://www.sonatype.com/books/m2eclipse-book/reference/]. In Eclipse Helios (3.6) the plugin is not yet part of the distribution, but you can install it from the Eclipse marketplace. Installation instructions can be found here: [http://www.sonatype.com/books/m2eclipse-book/reference/install-sect-marketplace.html http://www.sonatype.com/books/m2eclipse-book/reference/install-sect-marketplace.html]
 
You can learn more about the plugin here:&nbsp;[http://www.sonatype.com/books/m2eclipse-book/reference/ http://www.sonatype.com/books/m2eclipse-book/reference/]. In Eclipse Helios (3.6) the plugin is not yet part of the distribution, but you can install it from the Eclipse marketplace. Installation instructions can be found here: [http://www.sonatype.com/books/m2eclipse-book/reference/install-sect-marketplace.html http://www.sonatype.com/books/m2eclipse-book/reference/install-sect-marketplace.html]

Revision as of 12:46, 23 November 2011

Contents

Maven Repository Configuration

While we are packaging up Stardust for Eclipse, you can get free access to the Infinity Process Platform - the product Stardust originates from. After you followed the instructions on how to gain access to the Maven Repository, you can authenticate against the ipp-libs repository with the username and password you picked when registering. Further repositories Stardust builds may require are Maven Central, Java.net and Jboss public. To access these repositories from Maven make sure they are configured in your Maven settings.xml as shown below.

<repositories>
...
  <repository>
    <id>ipp-libs</id>
    <url>https://infinity.sungard.com/repository/ipp-libs/</url>
  </repository>
  <repository>
    <id>mavenCentral</id>
    <url>http://repo1.maven.org/maven2/</url>
  </repository>
  <repository>
    <id>public-jboss</id>
    <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
  </repository>
  <repository>
    <id>maven2-repository.java.net</id>
    <url>http://download.java.net/maven/2/</url>
  </repository>
...
</repositories>
Also configure the correct credentials for the ipp-libs repository as shown here:
<servers>
... 
  <server>
    <id>ipp-libs</id>
    <username>user.name</username>
    <password>clearTextPasswordOrPasswordHashFromRepository</password>
  </server>
...
</servers>

If you don't want to specify your password in clear text, you can encode it in the repository web portal:

  1. Go to https://infinity.sungard.com/repository Repository and login using your credentials
  2. Go to your user profile (link behind user name in upper right corner)
  3. Enter your password and press the Unlock button
  4. Copy the username and password section into your settings.xml as shown above


Other helpfull repositories could be ibiblio http://www.ibiblio.org/maven or the Nuxeo Apache repository http://maven.nuxeo.org/nexus/content/groups/public.

Maven Archetype

Starting from version 6.0.3 the ipp-libs Maven repository (https://infinity.sungard.com/repository/ipp-libs) contains a Maven archetype

(https://infinity.sungard.com/repository/ipp-releases/archetype-catalog.xml) that can be use to create the following Maven projects:

  • Engine runtime EAR project for JBOSS 5.1, EJB deplyoment, artefactId=ipp-archetype-jb51-ipp-ear
  • Engine runtime WAR project for JBOSS 5.1, Spring deplyoment, artefactId=ipp-archetype-jb51-ipp-portal-war
  • Reporting runtime WAR project for JBOSS 5.1, artefactId=ipp-archetype-jb51-reporting-war
  • Engine runtime WAR project for Tomcat 6, Spring deployment, artefactId=ipp-archetype-tc6-ipp-portal-war
  • Reporting runtime WAR project for Tomcat 6, artefactId=ipp-archetype-tc6-reporting-war
  • Console command line tool client environment project, Spring client, artefactId=ipp-archetype-console-spring-client
  • Sysconsole command lient tool client environment project (direct database access via JDBC), artefactId=ipp-archetype-sysconsole-client


For other application servers the example project coming closest to the target deployment can be adjusted. Additional archetypes for other deployment scenarios will be added soon.

  • The repository ipp-community-releases already contains a beta version of the Weblogic Spring WAR archetype. Due to the WLS license restrictions this archetype requires the property wlfullclient.dir to be supplied as a parameter. The value should be the WLS folder in which the JAR wlfullclient.jar can be found.


The goals 'dependency:unpack' (for runtimes) / 'generate-resources' (for console and sysconsole) have to be executed after the corresponding projects have been successfully created. However, project creation and goal execution can be combined in one by appending a -Dgoals parameter as shown in the examples below.

Example Usage

If the repository is not configured in your settings.xml then you have to supply the repository URL as an additional parameter to the mvn command:

-DarchetypeRepository=https://infinity.sungard.com/repository/ipp-libs

Runtime

mvn archetype:generate 
-DarchetypeGroupId=com.infinity.bpm.archetypes -DarchetypeArtifactId=ipp-archetype-tc6-ipp-portal-war
-DarchetypeVersion=6.0.3 -DgroupId=org.eclipse.stardust.test -DartifactId=stardust-portal-war -Dversion=1.0-SNAPSHOT
-Dgoals=dependency:unpack

Command Line

mvn archetype:generate
-DarchetypeGroupId=com.infinity.bpm.archetypes -DarchetypeArtifactId=ipp-archetype-console-spring-client
-DarchetypeVersion=6.0.3 -DgroupId=org.eclipse.stardust.test -DartifactId=stardust-console -Dversion=1.0-SNAPSHOT
-Dgoals=generate-resources

M2 Eclipse Plugin

The Maven Eclipse plugin is extremely helpful when working with maven projects under eclipse. It

  • allows you to create and import Maven projects
  • includes a form-based POM Editor
  • manages dependencies and integrates them with the Eclipse classpath
  • automatically downloads and updates dependencies
  • resolves artifact Javadoc and source
  • creates projects based on Maven archetypes
  • supports browsing and searching of remote and local Maven repositories
  • manages POMs with automatic updates to the dependency list
  • adapts nested multi-module Maven projects to the Eclipse IDE
  • provides integration with the Web Tools Project (WTP)
  • integrates with Subclipse and Mylyn
  • generates graphical displays of the dependency graph
  • allows to run maven goals from the IDE
  • ...

You can learn more about the plugin here: http://www.sonatype.com/books/m2eclipse-book/reference/. In Eclipse Helios (3.6) the plugin is not yet part of the distribution, but you can install it from the Eclipse marketplace. Installation instructions can be found here: http://www.sonatype.com/books/m2eclipse-book/reference/install-sect-marketplace.html