Maven managed warehouse Management in Eclipse (iv)

Source: Internet
Author: User


One: Use Nexus to create a local area network warehouse

1.1 Download Nexus

1.2 Unzip and set the bin directory to the environment variable

1.3 Configure the wrapper.conf of the Nexus Nexus-2.3.1-01\bin\jsw\conf, set the local Java path, as shown in figure


1.4 Run Cmd.exe as Administrator, perform nexus install

1.5 Execution of Nexus start in CMD after successful installation

1.6 After successful startup in the browser address bar access: http://localhost:8081/nexus/index.html

1.7 Login to the local Nexus

User name: admin

Password: admin123

II: Create a local area network warehouse

Warehouse Management:

1.nexus Warehouse Type explanation

2. Create a private warehouse

2.1 Adding the use warehouse for parent

Modify the configuration of the local maven; setting file location:

Add a local mirror for the two warehouses already configured

  <mirrors>

	 <mirror>
      <id>central</id>
      <mirrorOf>*</mirrorOf>
      <name>human readable name for this mirror.</name>
      <url>http://192.168.0.199:8081/nexus/ Content/groups/public/</url>
    </mirror>


2.2 Update index, set download Remote indexes to True

To view the current task list after saving


When you're done, you'll be able to use the

2.3 Remove factory settings from parent, and factory settings in Settings.xml

  <profiles>
	<profile>
	  <id>central-repos</id>
      <repositories>
        < repository>
          <id>central</id>
          <name>Central</name>
          <url>http:// central</url>
		  <releases><enable>true</enable></releases>
		  <snapshots >
				<enabled>true</enabled>
		 </snapshots>
        </repository>
      </ Repositories>
    </profile>


Where URLs don't make sense after you configure mirroring. After the configuration is complete, activation is required and the following code is enabled

  <activeProfiles>
    <activeProfile>central-repos</activeProfile>
  </activeprofiles >

2.4 Release of the project

Then modify the parent's Pom.xml file to add the following code:

  
  <distributionManagement>
  
  	<snapshotRepository>
  		<id>user-snapshots</id>
  		< Name>user Project snapshots</name>
  		<url>http://192.168.0.199:8081/nexus/content/repositories/ myuserrepossnapshots/</url>
  	</snapshotRepository>
  	
  	<repository>
  		<id> user-releases</id>
  		<name>user Project release</name>
  		<url>http:// 192.168.0.199:8081/nexus/content/repositories/myuserreposrelease/</url>
  	</repository>
  	
  </distributionManagement>
Add user information above the settings file. Assigning permissions to a user

  <servers>
	 <server>
      <id>user-snapshots</id>
      <username>kh</username >
      <password>123456</password>
    </server>

	<server>
      <id> user-releases</id>
      <username>kh</username>
      <password>123456</password>
    </server>

The MAVEN build input is then performed on the parent's pom.xml, or the clean deploy is performed;





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.