Using the Maven+svn+hudson continuous integration development Process Example "build two"

Source: Internet
Author: User
Tags svn

"description" Using Maven+svn+hudson for Continuous integration development method one: using MAVEN to manage project 1 maven main configuration file Settings main configuration introduction

Explanation of the main configuration of the settings file:

Localrepository: Local Warehouse configuration path

Offline: Whether it is offline, this is generally not configured, offline words will not be able to download the Central warehouse package

Servers: Configure user name password to access the Nexus

Mirrors: Used to access other libraries

Profiles: Personalized configuration, need to activate 2: In the pom.xml file configuration upload path, such as the following [can upload the path and download path to write the same]

1) Configuring the Pom file

      <distributionManagement>
           <repository>
              <id>nexus-releases</id>
              <name> Releases</name>
              <url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url>
         </repository>
   </distributionManagement>


2) Execute command: Mvndeploy

The results are as follows:

3: Configure the path of the download

1) Main configuration file:

<repositories>
    <repository> 
      <id>central</id> 
      <name>central</name > 
      <url>http://127.0.0.1:8081/nexus/content/repositories/central/</url> 
      <releases> 
        <enabled>true</enabled> 
      </releases> 
    </repository> 
  </repositories >

2) Adding a dependency will automatically download

This figure is tested with a locally-not-available dependency that downloads the jar package from the private central repository, and the downloaded path is the central warehouse path for pom.xml configuration instead of the default path


4 ways to convert a common project into a MAVEN project:

1) First eclipse has installed Maven's plugin and is already configured.

2) Create a new, empty MAVEN project

3) Place the Java files in the project under MAVEN's corresponding directory

4) Configure the Pom.xml file, add dependencies, and upload a central warehouse path, download the path of the jar package from the central repository

Configuring Pom.xml Dependencies

The following screen will be displayed to find the desired jar

two: Using MAVEN to integrate Nexus Management Central warehouse 1 Download Nexus file

This example uses the version of Nexus-2.5.1-01-bundle.zip, the download address can be downloaded on the official website 2 start Nexus. First unzip the Nexus, then cmd to the extracted directory, start the service

[The path to the default central repository is in the current directory]

[CENTRAL Download Warehouse path]:
3 Open Home

Http://127.0.0.1:8081/nexus/index.html#welcome

In the upper right corner login admin/admin123 will go to the main page

4 Central Warehouse Structure

Repositories is a central warehouse collection, divided into several warehouses, there are releases (release version)/central (central Warehouse)/snapshots (development version) and other warehouses 5 private warehouses

Users remotely use their own private central repository already in the previous chapter of the 3 said, want to use a private warehouse need to do some configuration, select Central, open the configuration, as shown in the following image:


The default Downloadremote Indexes is False, which is true to save. Log back in and stick to the warehouse path and discover that a lot of common jar packages have been downloaded

Three: Integrated Hudson Continuous Integration development

after the implementation of the jar package upload and download management, if it is a large project, need to ensure the continuous integration of project development, but also need to use Hudson, to do the Project timing compilation 1 Download hudson, this example download is up-to-date and can be easily downloaded on the official website

Hudson-3.0.1.war 2 starts Hudson, 8080 ports are used by default

Because Hudson is a jar file,

CMD to the Hudson directory

Input command

Java-jar Hudson-3.0.1.war

3 Open Home

Http://localhost:8080/, as shown in the following figure:


4 for System configuration:

Configure only two local JDK paths and MAVEN paths, as shown in the figure:


The following can be done to establish a new project, before the establishment of the project, the continuous development of the use of SVN, so we must first

SVN configuration 5 SVN configuration

SVN needs to download three resources (client, server side, Eclipse's SVN plugin)

Test instance with a path of File:///d:/MySVNRepo, start a good service, upload code to SVN 6 build Hudson Project

Choose to build a free-style software project 7 fill in the SVN path

The SVN resource path needs to be added here: File:///D:/MySVNRepo/mavenT

8 fill in the execution cycle and Maven execution commands click Save

*/10**** means to build every 10 minutes

9 Click Build Now, view build results, compile successfully

Click Console to view the project build process

1) Create a workspace first workspace

2) Update the SVN file to see if there are any updates and download them if they are available.

3) Execute command mvn XXXX (command)

4) return result Success/failure

If you do not see clearly, please see the following detailed records

Started by user anonymous Updating file:///D:/MySVNRepo/mavenCheck2 revision:2013-7-17 13:52:26 depth:infinity Ignoreexternals:false U Src\main\java\com\check2\checkmaven2.java at Revision (Workspace) $ mvn.bat Package [I
NFO] Scanning for projects ... 
[WARNING] [WARNING] Some problems were encountered while building the effective model for propcheck2:mavencheck2:jar:8.0.0 [WARNING] ' Dependen Cies.dependency. (groupId:artifactId:type:classifier) ' must be Unique:activeio:activeio:jar-version 1.1 vs 2.0-r118 @ Line, Colum n [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build
. 
[WARNING] [WARNING]
For this reason, the future Maven versions might no longer support building such malformed projects. 
[WARNING]                                                                         
[INFO] [INFO]------------------------------------------------------------------------[INFO] Building MavenCheck2 8.0.0 [ INFO]------------------------------------------------------------------------[INFO] [INFO]---maven-resources-plugin : 2.6:resources (default-resources) @ mavenCheck2---[WARNING] Using platform encoding (GBK actually) to copy filtered Res
Ources, i.e. build is platform dependent! [INFO] Copying 0 Resource [INFO] [INFO]---maven-compiler-plugin:2.5.1:compile (default-compile) @ mavenCheck2---[info] Nothi Ng to Compile-all classes is up to date [info] [INFO]---maven-resources-plugin:2.6:testresources (default-testresour  CES) @ mavenCheck2---[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform
dependent! [INFO] Copying 0 Resource [INFO] [INFO]---maven-compiler-plugin:2.5.1:testcompile (default-testcompile) @ mavenCheck2---[INF O] Nothing to Compile-all classes is up to date [info] [INFO]---maven-surefire-plugin:2.12.4:test (default-test) @ m AvenCheck2---[info] [INFO]---maven-jar-plugin:2.4:jar (default-jar) @ mavenCheck2---[info]------------------------------------------------------------------------[INFO] BUILD SUCCESS [INFO]----- -------------------------------------------------------------------[INFO] Total time:6.767s [INFO] finished at:wed Jul 13:52:50 CST [INFO] Final memory:7m/17m [INFO]------------------------------------------------------------ ------------finished:success


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.