Difference between revisions of "Installation of maven"

From MPDLMediaWiki
Jump to navigation Jump to search
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== Ubuntu (11.04) ==
This explanation is for an Ubuntu 7.10 environment. If you use another distribution or version, some commands
* install maven:
may slightly differ.  
* First download the maven binaries
<pre>
<pre>
wget http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.0.8-bin.tar.gz
  sudo apt-get install maven2
</pre>
</pre>
* Extract them to e.g /usr/local
* check mvn version
<pre>
<pre>
sudo tar xfvj apache-maven-2.0.8-bin.tar.gz -C /usr/local
  mvn -version
</pre>
</pre>
* Then adept some environment variables in you preferred terminal. For the bash for example, edit ''~/.bashrc''
 
== Windows ==
* First download the maven binaries.  
<pre>
<pre>
export MAVEN_OPTS="-Xmx1224m -Xms712m"
wget http://apache.abdaal.com/maven/binaries/apache-maven-2.2.1-bin.zip
export PATH=$PATH:<path_to_maven_install_dir>/bin
</pre>
</pre>
* Extract them to c:\programme for example.
* Now try running maven with this command
* Now try running maven with this command
<pre>
<pre>
mvn
mvn -version
</pre>
</pre>
* If the previous step was successful, point your browser to http://escidoc1.escidoc.mpg.de:8888/archiva and create an account.
 
If you want to contribute snapshot builds and releases to the project contact your local archiva administrator to grant you  
== Further common steps ==
the needed rights.  
 
* Create a file at ''~/.m2/settings.xml'' with the following entries
* If the previous steps was successful, point your browser to [http://rd.mpdl.mpg.de/nexus/ Nexus].
:If you want to contribute snapshot builds and releases to the project contact your local Nexus administrator to grant you  
:the needed rights.  
* Create a file at ''~/.m2/settings.xml'' or ''C:\Documents and Settings\<user>\.m2\repository'' for windows with the following entries
 
<pre>
<pre>
<settings>
<settings>
Line 29: Line 33:
           <id>mysettings</id>
           <id>mysettings</id>
           <properties>
           <properties>
                 <!-- here you can set systemwide properties, valid in all projects -->
                 <!-- here you can set and override systemwide properties, valid in all projects -->
                <escidoc.framework_access.framework.url>
                        http://localhost
            </escidoc.framework_access.framework.url>
             </properties>
             </properties>
     </profile>
     </profile>
Line 45: Line 46:
   <mirrors>
   <mirrors>
     <mirror>
     <mirror>
      <id>archiva.default</id>
            <id>nexus</id>
      <url>http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/</url>
            <url>http://rd.mpdl.mpg.de/nexus/content/groups/public</url>
      <mirrorOf>central</mirrorOf>
            <mirrorOf>*</mirrorOf>
    </mirror>
        </mirror>
   </mirrors>
   </mirrors>
   <servers>
   <servers>
       <server>
       <server>
         <id>deployment.webdav</id>
         <id>snapshots</id>
         <username>archiva_username</username>
         <username>nexus_username</username>
         <password>archiva_password</password>
         <password>nexus_password</password>
       </server>
       </server>
       <server>
       <server>
         <id>snapshots.webdav</id>
         <id>snapshots</id>
         <username>archiva_username</username>
         <username>nexus_username</username>
         <password>archiva_password</password>
         <password>nexus_password</password>
       </server>
       </server>
     </servers>
     </servers>
</settings>
</settings>
</pre>
</pre>
* Ask your administrator to give you the current user/password combinations and put it in the ''properties'' section of your ''setting.xml''
* Checkout the project, e.g common_services
* Checkout the project, e.g common_services
<pre>
<pre>
svn co https://zim02.gwdg.de/repos/common/trunk/common_services/
svn co https://zim02.gwdg.de/repos/common/trunk/common_services/
</pre>
</pre>
* Now pick a integration test module (e.g citationmanager_ear, pubman_logic_ear or faces_logic_ear) and type
<pre>
mvn clean install
</pre>
: This will download a jboss server for integration tests to your home folder.
* Now change into homefolder and do the following steps (for Ubuntu):
<pre>
cd jboss
mkdir server_eclipse
cp jboss-<jboss-version> server_eclipse
</pre>
: This will copy another jboss installation into server_eclipse, since it's not possible to have the same jboss installation for the integration tests and eclipse together.
: We will need that later if you want to use eclipse for developing.


You can now start developing. For the first try, why not trying to compile all the project modules?
You can now start developing. For the first try, why not trying to compile all the project modules?
Line 75: Line 92:
</pre>
</pre>
This should clean and compile all project modules.
This should clean and compile all project modules.
[[Category:Installation instruction]]
[[Category:How To]]

Latest revision as of 16:06, 5 July 2011

Ubuntu (11.04)[edit]

  • install maven:
  sudo apt-get install maven2
  • check mvn version
  mvn -version

Windows[edit]

  • First download the maven binaries.
wget http://apache.abdaal.com/maven/binaries/apache-maven-2.2.1-bin.zip
  • Extract them to c:\programme for example.
  • Now try running maven with this command
mvn -version

Further common steps[edit]

  • If the previous steps was successful, point your browser to Nexus.
If you want to contribute snapshot builds and releases to the project contact your local Nexus administrator to grant you
the needed rights.
  • Create a file at ~/.m2/settings.xml or C:\Documents and Settings\<user>\.m2\repository for windows with the following entries
<settings>
  <profiles>
  <profile>
          <id>mysettings</id>
           <properties>
                <!-- here you can set and override systemwide properties, valid in all projects -->
            </properties>
    </profile>
  </profiles>
   <activeProfiles>
     <!-- using a development environment -->
     <activeProfile>env-development</activeProfile>
     <!-- and jboss 4.0 -->
     <activeProfile>jboss42</activeProfile>
     <activeProfile>mysettings</activeProfile>
   </activeProfiles>
  <mirrors>
    <mirror>
            <id>nexus</id>
            <url>http://rd.mpdl.mpg.de/nexus/content/groups/public</url>
            <mirrorOf>*</mirrorOf>
        </mirror>
  </mirrors>
  <servers>
      <server>
        <id>snapshots</id>
        <username>nexus_username</username>
        <password>nexus_password</password>
      </server>
      <server>
        <id>snapshots</id>
        <username>nexus_username</username>
        <password>nexus_password</password>
      </server>
    </servers>
</settings>
  • Ask your administrator to give you the current user/password combinations and put it in the properties section of your setting.xml
  • Checkout the project, e.g common_services
svn co https://zim02.gwdg.de/repos/common/trunk/common_services/
  • Now pick a integration test module (e.g citationmanager_ear, pubman_logic_ear or faces_logic_ear) and type
mvn clean install
This will download a jboss server for integration tests to your home folder.
  • Now change into homefolder and do the following steps (for Ubuntu):
cd jboss
mkdir server_eclipse
cp jboss-<jboss-version> server_eclipse
This will copy another jboss installation into server_eclipse, since it's not possible to have the same jboss installation for the integration tests and eclipse together.
We will need that later if you want to use eclipse for developing.

You can now start developing. For the first try, why not trying to compile all the project modules? Go to the root of the working dir and type:

mvn clean compile

This should clean and compile all project modules.