jenkins automatically builds the release program

1. First go to https://jenkins.io/ to download the windows version of jenkins 2.6.3

2. Follow the prompts to the next step, follow the prompts to install the necessary controls, and create a user.

3. Enter: http://localhost:8080 to see if it can be accessed, default port: 8080
If you want to change the port number to 8000
1). Modify jenkins.xml under the installation path
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle= hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>

is modified to:
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle =hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8000 --webroot="%BASE%\war"</arguments>
Such as: D:\mysoft\Jenkins\jenkins.xml

system Management Tip: The reverse proxy settings are wrong
2). "System Management" - "System Settings", modify the port in the Jenkins URL in Jenkins Location
to 8000




4. Configure the global build tool
System Management - "Global Tool Configuration Set maven, jdk, svn, etc.





5. Create a new project and build it
Click "New", set the project name in the next page, and select the build type (in this example, select the type: Free-style software project ).




Click "Advanced" to select a custom software space and set the project path. Select Add timestamps to the Console Output




in "Build Environment" to




set "Build"
Maven Version: Set to maven path (already set in Global Tool Configuration, you can choose to set Ok maven)

POM: pom.xml (project configuration file)

File path: C:\Users\gjp\.m2\settings.xml (maven global configuration file)



6. Click "Build Now", found that the construction failed, failed The information is as follows:



Modify pom.xml and
add the following:
<build>
     <defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin< /artifactId>
<version>3.1<
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


and then single Click "Build Now" to complete the build.
View log:
10:10:58 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
10:10:58 10:10:58
[
INFO] 10:10:58 [INFO] --- maven- war-plugin:2.3:war (default-war) @ ssm_dream --- 10:10:58
[INFO] Packaging webapp
10:10:58 [INFO] Assembling webapp [ssm_dream] in [E:\2017rocketmq\ssm_dream\target \ssm_dream-0.0.1-SNAPSHOT]
10:10:58 [INFO] Processing war project
10:10:58 [INFO] Copying webapp resources [E:\2017rocketmq\ssm_dream\src\main\webapp]
10:10:58 [INFO] Webapp assembled in [26 msecs]
10:10:58 [INFO] Building war: E:\2017rocketmq\ssm_dream\target\ssm_dream-0.0.1-SNAPSHOT.war
10:10:58 [INFO]
10:10:58 [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ ssm_dream ---
10:10:58 [INFO] Installing E:\2017rocketmq\ssm_dream\target\ssm_dream-0.0.1-SNAPSHOT.war to C:\Windows\System32\config\systemprofile\.m2\repository\com\boce\itdream\ssm_dream\0.0.1-SNAPSHOT\ssm_dream-0.0.1-SNAPSHOT.war
10:10:58 [INFO] Installing E:\2017rocketmq\ssm_dream\pom.xml to C:\Windows\System32\config\systemprofile\.m2\repository\com\boce\itdream\ssm_dream\0.0.1-SNAPSHOT\ssm_dream-0.0.1-SNAPSHOT.pom
10:10:58 [INFO] ------------------------------------------ ----------------------------------------
10:10:58 [INFO] BUILD SUCCESS
10:10:58 [INFO] -- -------------------------------------------------- --------------------
10:10:58 [INFO] Total time: 1.843 s
10:10:58 [INFO] Finished at: 2017-08-31T10: 10:58+08:00
10:10:59 [INFO] Final Memory: 11M/27M
10:10:59 [INFO] --------------------- -------------------------------------------------- -
10:10:59 Finished: SUCCESS



7. Publish the program to tomcat 7 remotely,
1" System Management - "Plugin Management Installation Deploy to container Plugin
2" Modify tomcat-users.xml in tomcat
to:

<role rolename ="admin-gui"/> 
  <role rolename="admin-script"/> 
    <role rolename="  manager-gui"/> 
    <role rolename="manager-script"/> 
    <role rolename="manager-jmx"/> 
   <role rolename="manager-status"/> 
   <user password="admin" roles="manager-gui,manager-script ,manager-jmx,manager-status,admin-script,admin-gui" username="admin"/>

Note: The values ​​of username and password can be modified.

3" Start tomcat, and test whether the admin user can log in.

4. "Start to set up remote publishing:
click "my view", click "ssm_dream" (project name), and click "configure".
Post-build operation, select deploy war/ear to container
WAR/EAR files: release package path
Context path: access alias such as: http://localhost:9999/ssm

Credentials: Tomcat username and password

Tomcat URL: tomcat access path such as: http://localhost:9999





Go to the tomcat path to see if the file is published successfully: The



file is published successfully

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326305808&siteId=291194637