Difference between revisions of "Maven integration in eclipse"

From MPDLMediaWiki
Jump to navigation Jump to search
m (cat)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Prerequisites ==
== Prerequisites ==
* Eclipse 3.3.1.1
* Eclipse 3.4 (J2EE version) ([http://www.eclipse.org/downloads/ download])
* Subclipse plugin for eclipse 1.2.4 (get it [http://subclipse.tigris.org/install.html here])
* Subclipse plugin for eclipse 1.2.4 ([http://subclipse.tigris.org/install.html download])
 
== Install eclipse ==
 
* Download and extract the J2EE version of eclipse
** CAUTION Windows users: DO NOT INSTALL into a directory, which contains spaces !!!
* Go to ''Help->Software Updates''
* Choose ''Available software''
* Add a new remote site with the following URL:
<pre>
http://subclipse.tigris.org/update_1.6.x
</pre>
* Install everything


== Install the maven plugin ==
== Install the maven plugin ==
Do the following steps to install the maven plugin:
Do the following steps to install the maven plugin:
* Go to ''Help->Software Updates->Find and install...''
* Go to ''Help->Software Updates''
* Choose ''Search for new features to install''
* Choose ''Available software''
* Add a new remote site with the following info:
* Add a new remote site with the following URL:
<pre>
<pre>
Name: Maven
http://m2eclipse.sonatype.org/sites/m2e
URL: http://m2eclipse.codehaus.org/update
</pre>
</pre>
* Install version 0.0.11 of the plugin; 0.0.12 won't work since it's complaining about a misconfigured plugin
* Install everything except the ''Maven Integration for AJDT'' in the ''Project Configurators''
* Go to ''Window->Preferences
* Choose ''Maven->Installations'' and add a Maven installation pointing to your external Maven installation
* Check it and you done
'''Hint:''' You can now define your building requirenments for each project. For example to automatically deploy pubman_ear to jboss do the following:
* Richtclick on the pubman_ear project
* Go to ''Run As->Maven Build''
* A dialog box appears, where you enter ''clean install jboss:harddeploy'' as goals
* Apply, run
* The next time you select ''Run As->Maven Build'' the saved run will be processed


== Importing the projects ==
== Importing the projects ==
Line 34: Line 54:
* Now open a server view and righclick in it
* Now open a server view and righclick in it
* With ''New->Server'' you can add your created server runtime
* With ''New->Server'' you can add your created server runtime
* On some slow windows machines ;), you have to increase the waiting time for jboss to come up. Do this on tab ''Servers''. Click on runtime, then Open->Timeouts


[[Category:eSciDoc|Development environment]]
[[Category:ESciDoc]]
[[Category:eSciDoc-Team]]
[[Category:How To]]

Latest revision as of 13:19, 5 January 2011

Prerequisites[edit]

  • Eclipse 3.4 (J2EE version) (download)
  • Subclipse plugin for eclipse 1.2.4 (download)

Install eclipse[edit]

  • Download and extract the J2EE version of eclipse
    • CAUTION Windows users: DO NOT INSTALL into a directory, which contains spaces !!!
  • Go to Help->Software Updates
  • Choose Available software
  • Add a new remote site with the following URL:
http://subclipse.tigris.org/update_1.6.x
  • Install everything

Install the maven plugin[edit]

Do the following steps to install the maven plugin:

  • Go to Help->Software Updates
  • Choose Available software
  • Add a new remote site with the following URL:
http://m2eclipse.sonatype.org/sites/m2e
  • Install everything except the Maven Integration for AJDT in the Project Configurators
  • Go to Window->Preferences
  • Choose Maven->Installations and add a Maven installation pointing to your external Maven installation
  • Check it and you done

Hint: You can now define your building requirenments for each project. For example to automatically deploy pubman_ear to jboss do the following:

  • Richtclick on the pubman_ear project
  • Go to Run As->Maven Build
  • A dialog box appears, where you enter clean install jboss:harddeploy as goals
  • Apply, run
  • The next time you select Run As->Maven Build the saved run will be processed

Importing the projects[edit]

To import all the submodules of a project, do the following:

  • Go to Files->Import...
  • Choose General->Maven projects
  • Now choose the root of your projects folder (it's the one with a pom.xml and the submodule folders)
  • Check every project and import all the modules

You will get a parent eclipse project with all submodules and eclipse projects of all the submodules.

Attention, at the moment, the subversion plugin only works from the parent eclipse project.

Define the JBoss instance[edit]

For local testing a JBoss server can be used to deploy the project artifact. To define a JBoss instance in eclipse, do the following:

  • Go to Window->Preferences...
  • Choose Server->Installed Runtimes->Add...
  • Choose a JBoss Version (normally 4.2) and add the path to your JBoss installation. Remember, use the server in jboss/server_eclipse!
  • Now open a server view and righclick in it
  • With New->Server you can add your created server runtime
  • On some slow windows machines ;), you have to increase the waiting time for jboss to come up. Do this on tab Servers. Click on runtime, then Open->Timeouts