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

From Eclipsepedia

Jump to: navigation, search
(Available Archetypes)
(One intermediate revision by one user not shown)
Line 53: Line 53:
 
==== Available Archetypes  ====
 
==== Available Archetypes  ====
  
Starting from version 6.0.3 the ''ipp-libs'' Maven repository ([https://infinity.sungard.com/repository/ipp-libs/ https://infinity.sungard.com/repository/ipp-libs]) contains Maven archetypes<br>  
+
Starting from version 6.0.3 the ''ipp-libs'' Maven repository ([https://infinity.sungard.com/repository/ipp-libs/ https://infinity.sungard.com/repository/ipp-libs]) contains Maven archetypes.<br>  
 +
 
 +
The vcorresponding archetypes for Stardust are work in progress and will become availabe once we can publish the Stardust build aretfacts to a public maven repository.
  
 
(https://infinity.sungard.com/repository/ipp-releases/archetype-catalog.xml) that can be use to create the following Maven projects:  
 
(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'''<br>
+
'''JBOSS 5.1'''  
*Engine runtime '''WAR '''project for '''JBOSS 5.1''', '''Spring '''deplyoment, artefactId='''ipp-archetype-jb51-ipp-portal-war'''<br>
+
 
*'''Reporting '''runtime WAR project for '''JBOSS 5.1''', artefactId='''ipp-archetype-jb51-reporting-war'''<br>
+
*ipp-archetype-jb51-ipp-ear - prepares an EAR deployment for JBoss 5.1. Also contains a console module which invokes the calls against an EAR deployment.
*Engine runtime WAR project for '''Tomcat 6''', '''Spring''' deployment, artefactId='''ipp-archetype-tc6-ipp-portal-war'''<br>
+
*ipp-archetype-jb51-ipp-portal-war - prepares a WAR deployment for JBoss 5.1.
*'''WAR''' deployment for '''Weblogic 11''' (aka 10.3.3),&nbsp;artefactId='''ipp-archetype-wls11-ipp-portal-war
+
*ipp-archetype-jb51-reporting-war - prepares a Reporting WAR deployment for JBoss 5.1.
*'''EAR''' deployment for '''Weblogic 11 '''(aka 10.3.3)'''&nbsp;'''and '''console''' environment for EJB, artefactId='''ipp-archetype-wls11-ipp-ear
+
 
*'''Reporting''' runtime WAR project for '''Weblogic 11 '''(aka 10.3.3)''', '''artefactId='''ipp-archetype-wls11-reporting-war
+
'''Tomcat 6'''  
*'''Reporting '''runtime WAR project for '''Tomcat 6, '''artefactId='''ipp-archetype-tc6-reporting-war'''<br>
+
 
 +
*ipp-archetype-tc6-ipp-portal-war - prepares a Infinity Process Platform Portal WAR deployment for Tomcat 6.
 +
*ipp-archetype-tc6-reporting-war - prepares a Reporting WAR deployment for Tomcat 6.
 +
 
 +
'''Weblogic 11 (aka 10.3.3)'''  
 +
 
 +
*ipp-archetype-wls11-ipp-ear - prepares an EAR deployment for Weblogic 11 (aka 10.3.3) and provides a console environment for EJB.
 +
*ipp-archetype-wls11-ipp-portal-war - prepares a WAR deployment for Weblogic 11 (aka 10.3.3).
 +
*ipp-archetype-wls11-reporting-war - prepares a Reporting WAR deployment for Weblogic 11 (aka 10.3.3).
 +
 
 +
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.
 +
 
 +
'''Websphere 7'''
 +
 
 +
*ipp-archetype-was7-ipp-ear - prepares an EAR deployment for WebSphere 7 and provides a console environment for EJB.
 +
*ipp-archetype-was7-ipp-portal-war - prepares a WAR deployment for WebSphere 7.
 +
*ipp-archetype-was7-reporting-war - prepares a Reporting WAR deployment for WebSphere 7.
  
*'''Console''' command line tool client environment project, '''Spring '''client, artefactId='''ipp-archetype-console-spring-client'''<br>
+
'''Websphere 8'''  
*'''Sysconsole '''command lient tool client environment project (direct database access via JDBC), artefactId='''ipp-archetype-sysconsole-client'''<br>
+
  
<br>
+
*ipp-archetype-was8-ipp-ear - prepares an EAR deployment for WebSphere 8 and provides a console environment for EJB.
 +
*ipp-archetype-was8-ipp-portal-war - prepares a WAR deployment for WebSphere 8.
 +
*ipp-archetype-was8-reporting-war - prepares a Reporting WAR deployment for WebSphere 8.
  
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>
+
'''Commandline Tools'''
  
*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>
+
*ipp-archetype-console-spring-client - creates a Spring based console environment.  
 +
*ipp-archetype-sysconsole-client - creates a sysconsole client environment.<br>
  
 
<br>  
 
<br>  

Revision as of 01:24, 24 October 2012

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 helpful repositories could be ibiblio http://www.ibiblio.org/maven or the Nuxeo Apache repository http://maven.nuxeo.org/nexus/content/groups/public.

Stardust Maven Archetypes

Available Archetypes

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

The vcorresponding archetypes for Stardust are work in progress and will become availabe once we can publish the Stardust build aretfacts to a public maven repository.

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

JBOSS 5.1

  • ipp-archetype-jb51-ipp-ear - prepares an EAR deployment for JBoss 5.1. Also contains a console module which invokes the calls against an EAR deployment.
  • ipp-archetype-jb51-ipp-portal-war - prepares a WAR deployment for JBoss 5.1.
  • ipp-archetype-jb51-reporting-war - prepares a Reporting WAR deployment for JBoss 5.1.

Tomcat 6

  • ipp-archetype-tc6-ipp-portal-war - prepares a Infinity Process Platform Portal WAR deployment for Tomcat 6.
  • ipp-archetype-tc6-reporting-war - prepares a Reporting WAR deployment for Tomcat 6.

Weblogic 11 (aka 10.3.3)

  • ipp-archetype-wls11-ipp-ear - prepares an EAR deployment for Weblogic 11 (aka 10.3.3) and provides a console environment for EJB.
  • ipp-archetype-wls11-ipp-portal-war - prepares a WAR deployment for Weblogic 11 (aka 10.3.3).
  • ipp-archetype-wls11-reporting-war - prepares a Reporting WAR deployment for Weblogic 11 (aka 10.3.3).

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.

Websphere 7

  • ipp-archetype-was7-ipp-ear - prepares an EAR deployment for WebSphere 7 and provides a console environment for EJB.
  • ipp-archetype-was7-ipp-portal-war - prepares a WAR deployment for WebSphere 7.
  • ipp-archetype-was7-reporting-war - prepares a Reporting WAR deployment for WebSphere 7.

Websphere 8

  • ipp-archetype-was8-ipp-ear - prepares an EAR deployment for WebSphere 8 and provides a console environment for EJB.
  • ipp-archetype-was8-ipp-portal-war - prepares a WAR deployment for WebSphere 8.
  • ipp-archetype-was8-reporting-war - prepares a Reporting WAR deployment for WebSphere 8.

Commandline Tools

  • ipp-archetype-console-spring-client - creates a Spring based console environment.
  • ipp-archetype-sysconsole-client - creates a sysconsole client environment.


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 command 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

If you chose to download the archetype catalog locally, then you can supply the location of the directory where you saved the catalog file:

-DarchetypeCatalog=file://C:/Stardust/misc/

Runtime

mvn archetype:generate 
-DarchetypeGroupId=com.infinity.bpm.archetypes -DarchetypeArtifactId=ipp-archetype-tc6-ipp-portal-war
-DarchetypeVersion=7.0.0 -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=7.0.0 -DgroupId=org.eclipse.stardust.test -DartifactId=stardust-console -Dversion=1.0-SNAPSHOT
-Dgoals=generate-resources

M2 Eclipse Plugin

Introduction

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 artefact 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

Installation instructions can be found here: http://www.sonatype.com/books/m2eclipse-book/reference/install-sect-marketplace.html

Apart from the required M2E plugin it is recommended to additionally install the optional "Maven Integration for WTP" plugin from the M2E Extras section!

Stardust Archetype Catalog Configuration

Please make sure your M2 Eclipse uses a properly configured Maven version as described in the Troubleshooting section.

Remote Archetype Catalog

Before you can use the Stardust Archetype Catalog with M2 Eclipse you need to configure the catalog initially. When creating a new Maven project with M2 Eclipse you will be present with the archetype selection dialog.

AddStardustArchetypeCatalog.gif


Local Archetype Catalog

You can also add the Stardust archetype catalog as a local catalog to M2Eclipse.

Creating a local Stardust Archetype Catalog in M2 Eclipse


Browsing the local Stardust Archetype Catalog in M2 Eclipse


Troubleshooting

  • Add wagon-http Jar if you are using Maven 3.0.4 behind a Proxy

Maven 3.0.4 has a bug preventing it from downloading dependencies from behind a proxy. An error starting with "Failed to retrieve plugin descriptor …" will appear. Either switch to Maven 3.0.3 or download repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-http-lightweight/2.2/wagon-http-lightweight-2.2.jar and add it to Maven's \lib\ext sub folder.

  • Check if the repository password or password hash in your setting.xml is up-to-date

If your password hash is outdated then Maven unfortunately won't display an meaningful error message. It will simply not download the artifacts from the repository. Instead Maven will try to fetch the artifacts from the other configured repositories. Finally the build will fail with an error message indicating that the artifact could not be downloaded. Log into the repository web app, click on your name and generate a new password hash. Then update the password hash in your settings.xml with the new value.

  • Remember to run dependency:unpack / generate-resources goal

If you experience problems related to missing files like e.g. sun-jaxws.xml then you may have forgotten to run the goal dependency:unpack.

If you want to use the command line tools console or sysconsole and cannot find the bat / sh files then you may have forgotten to run the goal generate-resources.

  • Make sure you are using the right Maven installation / settings.xml and have configured the credentials properly

If you experience any problems in using the Stardust archetype catalog or in building maven projects using M2 Eclipse, then this may be due to the fact that your M2 Eclipse is configured to use the embedded Maven version that ships with it. Unless you configured it accordingly this Maven version uses another settings.xml which does not contain the credentials and repositories required to access the archetype catalog and the artifacts in the repository.

M2EclipseCouldNotFindArchetype.gif

An easy solution is to change the Maven version used by M2 Eclipse to a correctly configured Maven version (Probably you have a Maven version which you use outside Eclipse which is configured correctly).

ChangingM2EclipseMavenVersion.gif