Jenkins under Maven+tomcat building a Web project

Source: Internet
Author: User

1. Create a new MAVEN project: Click the New button in the top left corner, enter the task name in the input box, and select "Build a free-form software project"

If you have a project that already exists very similar, you can choose Copy from build for convenience

2. Source Control: Select Subversion, enter the SVN address in the Repository URL, click the Add button after credentials, enter SVN's account and password in username and password, After saving, select the account password in the selection box:

3. Build the trigger:

build whenever a snapshot dependency is built: executes this job when the job depends on the snapshot version being build.

buildAfter other projects is built: This job is executed when the job to which this job depends is build

Build periodically : build once at a time, typically not in this way, regardless of whether the repository code has changed.

Poll SCM : When you select this option, you can specify a timed job expression to define how often Jenkins checks your source code repository for changes. If a change is found, the build is executed once. For example, filling in an expression with 0,15,30,45 * * * * will allow Jenkins to check your repository changes every 15 minutes. It is usually built in this way.

4. Build: Choose Invoke top-level MAVEN targets in the Add build step

Maven version: Enter the locally installed MAVEN release;

Goals: Generally enter clean clear and then package, if you have a profile that needs to be changed to what you want, use-PXXX,XXX to refer to the folder where you built your profile. For example, when you enter-ptest, the package uses the configuration file under the Test folder.

POM: Input pom.xml;

Common MVN Commands:

MVN Package: packaging;

MVN clean: empty;

Mvn-dmaven.test.skip=true XXX: Skip test run maven task;

MVN–PXXX: Activate the profile with ID XXX (if there are multiple, separated by commas);

Mvn–ff:--fail-fast the construction failure, and then exits directly;

MVN-FN--fail-never No matter how the project results, the construction never fails;

Mvn-fae--fail-at-end only affects build results, allowing non-affected builds to continue;

Mvn-c--strict-checksums If the checksum code does not match, the construction fails;

Mvn-c--lax-checksums If the checksum code does not match, the alarm is generated;

Mvn-u force update of snapshot type plug-ins or dependent libraries (otherwise MAVEN will only update one snapshot dependency per day);

Mvn-npu--no-plugin-s does not check for any relevant registered plugins (Use this option to make Maven behave stably, based on all plug-in versions currently available in the local repository);

MVN-CPU--check-plugin-updates enforces the latest checks on any relevant registered plugins (even if the MAVEN plugin version is explicitly specified in the project POM, or it is forced to be updated);

Mvn-f--file <file> Mandatory use of spare pom files;

Mvn-s--settings <arg> User Configuration file alternate path;

Mvn-gs--global-settings <file> Global configuration file alternate path;

You can see it under the default path target file after packaging

You can also modify the specific path information in system administration-system settings here, such as:

5. Remote Deployment configuration: After the build operation Select Deploy War/ear to a container (need to install the Deploy plugin plugin first)

After selection as:

war/ear files: The name of the package WAR file, such as target/ Sgp-v2.1.2.war, where target is the name of its own, the default is target,sgp-v2.1.2 is obtained from the Pom.xml, the. War is a suffix. As in the Pom file section, you can learn that the war name is called the sgp-version number

If the version is 2.1.2, the war package is named Sgp-v2.1.2.war:

Context Path: The folder name stored under the webapp of Tomcat after the war package is decompressed.

Container: Select your Web container, such as TOMCA 7.x

Manager User name: Fill in the username content of the Tomcat-users.xml configuration

Manager Password: Fill in the password content of the Tomcat-users.xml configuration

(You will need to add the following to the <tomcat-users> node by first conf the Tomcat directory with the Tomcat-users.xml file:

<role rolename= "Manager-gui"/>

<role rolename= "Manager-script"/>

<role rolename= "Manager-jmx"/>

<role rolename= "Manager-status"/>

<user username= "Viewshine" password= "123456" roles= "Manager-gui, Manager-script,manager-jmx,manager-status"/ >

Username and password content can be written on their own)

Tomcat URL: Fill in the address of the tomcat you want to deploy, such as http://192.168.x.x:8080/

Jenkins under Maven+tomcat building a Web project

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.