Linux installation and configuration, and build a nexus PW maven3.0

2010-10-15  来源:本站原创  分类:Development  人气:362 

First, the software is ready
1, apache-maven-3.0-bin.tar.gz
2, nexus-oss-webapp-1.8.0-bundle.tar.gz

Second, maven installation configuration
1, create a maven user groups need to operate and user (if not created by root user installed)

#groupadd configer  // Create user groups
#useradd -g configer configer  // Create users and specify a user group
#passwd configer  // Assign a password for the user

2, extract the directory created, and apache-maven-3.0-bin.tar.gz extract the files to a specified directory

#cd /opt
#mkdir maven
#chown -R configer:configer /opt/maven
#chmod 755 /opt/maven
#su -l configer
#tar -zvxf apache-maven-3.0-bin.tar.gz

2, configure the environment variables

#vi /home/configer/.bash_profile

Add the following line in the file:

M2_HOME=/opt/maven/apache-maven-3.0
export M2_HOME
PATH=$PATH:$M2_HOME/bin
export PATH

3, view the version

#cd /opt/maven/apache-maven-3.0/bin
#mvn --version

If the version information, should be in the $ {user} directory created. M2 directory

4, see. M2 directory

#cd /home/configer/.m2
 If no .m2 directory  , You can manually add a
#mkdir .m2

5, if you need to specify the maven's repository directory to another directory, modify the maven installation directory in the configuration file conf file settings.xml

#vi /opt/maven/apache-maven-3.0/conf/settings.xml
 In the file  <localRepository>....</localRepository> Comments are open
 Or in the file increases in this comment by increasing
<localRepository>your repository path</localRepository>

Second, build nexus PW
1, extract nexus-oss-webapp-1.8.0-bundle.tar.gz files to specified directory

#tar -zvxf nexus-oss-webapp-1.8.0-bundle.tar.gz

2, start nexus

#cd /opt/maven/nexus-oss-webapp-1.8.0/bin/jsw

 Choose your own versions of the machine  :

#cd linux-x86-32/
#./nexus start

 Restart  :
#./nexus restart
 Stop  :
#./nexus stop

3, run the nexus
In the browser, type: http://localhost:8081/nexus
You can see the nexus of the home page, click Log in the upper right corner
The default user name and password are: admin/admin123
Will automatically generate a running nexus work directory sonatype-work, nexus download package will be stored in the jar
sonatype-work/nexus/storage in

4, the configuration
1) Click on the left menu Repositories
List on the right, respectively,

Apache Snapshots
Codehaus Snapshots
Maven Central

Download Remote Index repository of the three configurations to True, and save the settings,
Then right-click in the list were three Repository, click ReIndex

2) add a new Repository, a jar wrapped in some of the more commonly used to provide a repository nexus may be found,
There is generally more common

JBOSS Two of the  :
http://repository.jboss.org/maven2/
http://repository.jboss.org/nexus/content/repositories/releases/
SUN By  :
http://download.java.net/maven/2/
K-INT By  :
http://developer.k-int.com/maven2/

 Because find  juel:juel-impl:2.2.1  This jar package  , So I also added a finding of  :
http://repository.exoplatform.org/content/groups/public/

Add these steps:

Click on the  Add->Proxy Repository-> Fill out the Repository ID, Name, and the Repository  Remote Storage Location  Other default to  .

3) The Repository will be added to the Public Repositories of the Configuration of the Public Repositories will be multiple choice items in the Select all add to the left, then save it.

4) add your own jar package

In a repository list  3rd party, That is a third-party jar package  , Click here to see an Artifact Upload tab  , Click here, fill in the appropriate information  .
GAV Definition  General selection   GAV Parameters
 And then add  Group:Artifact:Version:Package
 Example      juel:juel-impl:2.2.1:jar

Jar and then choose to upload package, you can save

5) nexus to set the proxy server administrator menu on the left select the Server option in the right side of the opening in the bottom of the page, there is a selection: Default HTTP Proxy Settings (optional) to check box selected, fill in the appropriate Proxy server information can be.

6) write your own settings.xml, file contents are as follows:

<settings>
  <proxies>
    <proxy>
      <id>normal</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>deployment</username>
      <password>deploy</password>
      <host>localhost:8081/nexus</host>
      <port>80</port>
      <nonProxyHosts>localhost:8081/nexus</nonProxyHosts>
    </proxy>
  </proxies>

  <mirrors>
    <mirror>
      <!--This is used to direct the public snapshots repo in the
          profile below over to a different nexus group -->
      <id>nexus-public-snapshots</id>
      <mirrorOf>public-snapshots</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
    </mirror>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>development</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
    <profile>
      <!--this profile will allow snapshots to be searched when activated-->
      <id>public-snapshots</id>
      <repositories>
        <repository>
          <id>public-snapshots</id>
          <url>http://public-snapshots</url>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>public-snapshots</id>
          <url>http://public-snapshots</url>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>development</activeProfile>
  </activeProfiles>
</settings>

Settings.xml file will be copied to $ {user} /. M2 directory

7) Create a maven project test

#mvn archetype:generate

If you create a web project you can choose 83
Fill out the appropriate information, maven will download from the PW corresponding jar package, see the address should be localhost projects are successfully created, the pom.xml file in your project, the implementation of

#mvn install  Or  #mvn package

mvn pom.xml file will download the definition of dependent jar

After the download is complete, you can specify the repository directory in their own, if not specified, the directory is in the .m2/repository jar package to view their own

Thus, our structures maven installation and PW work is complete.

相关文章
  • Linux installation and configuration, and build a nexus PW maven3.0 2010-10-15

    First, the software is ready 1, apache-maven-3.0-bin.tar.gz 2, nexus-oss-webapp-1.8.0-bundle.tar.gz Second, maven installation configuration 1, create a maven user groups need to operate and user (if not created by root user installed) #groupadd conf

  • Linux installation and configuration, and build nexus PW maven3.0 2010-10-15

    First, the software is ready 1, apache-maven-3.0-bin.tar.gz 2, nexus-oss-webapp-1.8.0-bundle.tar.gz Second, maven installation configuration 1, create a maven user groups need to operate and user (if not created by root user installed) #groupadd conf

  • Linux installation and configuration maven3.0 build a nexus PW 2010-10-15

    First, the software is ready 1, apache-maven-3.0-bin.tar.gz Download: http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0-bin.tar.gz 2, nexus-oss-webapp-1.8.0-bundle.tar.gz Download: http://nexus.sonatype.org/downloads/ Two, maven in

  • Linux installation and configuration test applications under Essbase9.31 2010-11-11

    These days, that is, under Linux installation and configuration Essbase9.31, under the following to introduce some of my experience, for everyone to share! To be continued!

  • linux installation and configuration steps java Environment 2011-08-23

    linux installation and configuration steps java environment, the operating system

  • The following svn + apache linux installation and configuration 2010-06-30

    APACHE SVN under Linux server set up the whole process of a first related to the installation package is ready, I am using here is the following a few packages Apr: apr-1.2.11.tar.gz and apr-util-1.2.2.tar.gz Apache: httpd-2.2.6.tar.gz Subversion: su

  • Linux, installation and configuration of MRTG 2011-01-13

    MRTG SNMP from the device to get through the use of equipment (such as switches) and network traffic information, and the PNG graphics in HTML format display it easy to monitor the network administrator on the device (switch) to manage. Can be manage

  • Linux installation and configuration of OpenSSH 2010-12-10

    Many network programs, such as telnet, rsh, rlogin, or rexec, clear text (plain text) passwords and confidential information transmission, so you can use any computer connected to the network monitor these procedures and communication between the ser

  • Java environment for Linux installation and configuration 2011-07-08

    Keywords: Linux under Java environment installation and configuration First, download the JDK Download jdk-6u1-linux-amd64.bin, 64-bit machine Second, the installation (1) opt, create a new folder java # Mkdir / opt / java (2) The JDK I use ftp to pu

  • [Change] Linux installation and configuration under SubVersion 2010-08-26

    Reference: http://techhouse.blog.sohu.com/112937162.html subverion not introduce more friends, following the installation and configuration details Environmental and software installation: 1) RedHat AdvanceServer 4 Update 4 2) subversion-1.6.0 3) apa

  • JDK Linux installation and configuration environment variable 2011-07-04

    1. Quguan network to download jdk-6u26-linux-i586.bin this version of the extract can be used directly 2. You can create directories in usr following java packages on the download file below this directory Enter command in the current directory chmod

  • [Reprinted] linux installation and configuration under the samba 2010-02-18

    Just beginning to learn samba, to thank the original author. Set in Ubuntu samba share read-write folder collection first is to install samba, and Oh: Code: sudo apt-get install samba sudo apt-get install smbfs Now we can read and write to shared gro

  • Nginx + tomcat under linux installation and configuration of integrated 2010-04-08

    Objective: To build Nginx integration with tomcat, apache with Nginx instead of Steps: First, install Tomcat and JDK 1, From apache-tomcat-6.0.18.tar.gz and jdk-6u12-linux-i586.bin to / usr / local 2, execute the following command to install tomcat:

  • Fine HelixServer Unlimited 11 for Linux Installation and Configuration (1) 2010-05-31

    Source: http://www.cublog.cn/u/10500/showart.php?id=118180 Online circulating one "<stream media detail Helix Server installation, configuration>> article gave a detailed Helix_DNA_Server_10.1.tar.gz installation method, and today I successf

  • HelixServer Unlimited 11 for Linux installation and configuration details (1) 2010-05-31

    Source: http://www.cublog.cn/u/10500/showart.php?id=118180 Online circulating one "<stream media detail Helix Server installation, configuration>> article gave a detailed Helix_DNA_Server_10.1.tar.gz installation method, and today I successf

  • Oracle 10g under Linux installation and configuration 2010-10-09

    One. Resource requirements: At least 1024 MB of physical memory 1024-2048 to be 1.5 times the interaction space 2048-8192 to be 1 times the interaction space 8192 - the interactive space to be at least 0.75 times the 400 MB / tmp temporary directory

  • Installing MySQL under the free version of Linux installation and configuration records 2010-10-21

    First, the preparations Note: Because it is in a present and can be installed on the server multi-use, you need to make sure under the station is installed on the server Mysql 1, groupadd mysql mysql prompt already exists, useradd-g mysql mysql promp

  • Linux installation and configuration under the MySQL5.0.90 2010-11-08

    1, download the installation files for MySQL MySQL installation requires the following two files: MySQL-server-5.0.90-1.i386.rpm MySQL-client-5.0.90-0.i386.rpm Download address: http://mirrors.sohu.com/mysql/MySQL-5.0/. Download the article available

  • SVN under Linux installation and configuration records 2009-09-24

    Transfer: http://blog.csdn.net/zym361589736/archive/2009/07/26/4381557.aspx Chapter Installation 1 using the source files compile and install. A total of two source files for: subversion-1.6.1.tar.gz (subversion source file) subversion-deps-1.6.1.tar

  • Mysql under Linux installation and configuration 2011-08-02

    Turn: find a partner network http://www.zhaobanr.com/mysql-non-install-in-linux/ 1, download mysql file, download the free installation of this file: mysql-5.0.83-linux-i686-glibc23.tar.gz 2, log on Linux , copy the file to the / user / local / under