Simple use of Maven repository building (nexus) and mavan in Linux

Source: Internet
Author: User
I am not familiar with Linux and Maven, and I am not familiar with it on the Internet. Then I will summarize it as follows:
1. Build a repository (JDK required ):

Linux platform, IP: 192.168.2.991.download apache-maven-x.x.x-bin.tar.gz2.download nexus-oss-webapp-x.x.x.x-bundle.tar.gz3.tar-zxvf apache-maven-x.x.x-bin.tar.gz-C/usr/Java/4.add enviroment variable:. VI/etc/profile; B. append 'maven _ home =/usr/Java /***'

C. append 'path =$ {path }:$ {maven_home}/bin 'd. append 'export maven_home path 'E. source/etc/profile5.tar-zxvf nexus-oss-webapp-x.x.x.x-bundle.tar.gz-C/usr/Java/6. startup (shutdown) nexus:. CDS nexus/nexus-oss-webapp-1.9.0.2/bin/JSW/linux-x86-32/B .. /nexus start (STOP) 7. test: http: // localhost: 8081/nexusok, login as admin/admin123
(Default) Ii. Use the mavan Repository:Windows platform, IP: 192.168.2.31.download and setup apache-maven-x.x.x-bin.zip (D:/Maven) 2.add enviroment variable: New maven_home: D:/mavenadd to path: % maven_home %/bintest: MVN-version, ok3.open the file "settings. XML
"Under the folder" D:/Maven/conf "add the next chars into the file: <localrepository> C:/. m2/Repository </localrepository>
<Servers>
<Server>
<ID> nexus-releases </ID>
<Username> admin </username>
<Password> admin </password>
</Server>
<Server>
<ID> nexus-snapshots </ID>
<Username> admin </username>
<Password> admin </password>
</Server>
</Servers>

<Mirrors>
<Mirror>
<Mirrorof> * </mirrorof>
<Name> Linux-nexus </Name>
<URL> http: // 192.168.2.99: 8081/nexus/content/groups/Public </URL>
<ID> nexus </ID>
</Mirror>
</Mirrors>
<Profiles> <profile> <ID> Dev </ID> <repositories> <repository> <ID> nexus </ID> <URL> http: // 192.168.2.99: 8081/nexus/content/groups/public/</URL> <releases> <enabled> true </enabled> </releases> <snapshots> <enabled> true </enabled> </snapshots> </Repository> </repositories> <pluginrepositories> <pluginrepository> <ID> nexus </ID> <URL> HTTP: // 192.168.2.99: 8081/nexus/content/groups/Public </URL> <releases> <enabled> true </enabled> </releases> <snapshots> <enabled> true </enabled> </snapshots> </pluginrepository> </pluginrepositories> </profile> </profiles> <activeprofiles> <activeprofile> Dev </activeprofile> </activeprofiles> save, OK .4.mkdir "D:/workspace" 5.MVN archetype: generate
6. choose the default selection (16) 7. input some informations (the Project name: helloworld) 8. OK, look the Dir "D:/workspace", there is a folder "helloworld" 9. open the file "pom. XML
"Under" helloworld ", add some dependencies, example: <dependency>

<Groupid> org. springframework </groupid>
<Artifactid> spring </artifactid> <version> 2.5.6.sec02 </version> <type> jar </type> <scope> compile </scope> </dependency> <groupid> Org. apache. struts </groupid>
<Artifactid> struts2-core </artifactid>
<Version> 2.2.1 </version> <type> jar </type> <scope> compile </scope> </dependency> <groupid> javax. servlet </groupid> <artifactid> servlet-API </artifactid> <version> 2.5 </version> <type> jar </type> <scope> compile </scope> </dependency> 10.run the command "MVN install
"Under" helloword ", then, it will download some jars and poms into" C :/. m2/repository "(default) from 192.168.2.99.11.convert this Maven project to eclipse project: Under the folder" helloworld ", run" MVN Eclipse: Eclipse

". Note: 192.168.2.99 is the Linux IP address in the virtual machine, and 192.168.2.3 is the win7 IP address in the virtual machine.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.