Exploring the automation system of the architecture development of the EE project

Source: Internet
Author: User

Sentia  

    1. ECLIPSE IDE Development environment
    2. MAVEN build automation compiles packaged projects
    3. NEXUS Private Maven Warehouse
    4. SVN source Management
    5. junit+mockito Unit test and mock frame
    6. Coverage of integrated JACOCO Analysis Unit tests
    7. Jenkins Integration
    8. Sonar analyzes source code quality
    9. Glassfish Web Container Publishing
Everyone is talking about the era of agile development, so-called 工欲善其事 its prerequisite ... Before that, there had to be a JDK environment, not much to say. Maven Integrated Jacoco Analysis single-test coverage

Add the following configuration to the parent project's Pom.xml

<build><plugins> ... <plugin><groupid>org.jacoco</groupid><arti factid>jacoco-maven-plugin</artifactid><version>0.7.5.201505241946</version>< Executions><execution><id>default-prepare-agent</id><goals><goal> Prepare-agent</goal></goals></execution><execution><id> Default-prepare-agent-integration</id><goals><goal>prepare-agent-integration</goal> </goals></execution><execution><id>default-report</id><goals><goal> report</goal></goals></execution><execution><id>default-report-integration</ Id><goals><goal>report-integration</goal></goals></execution></executions ></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId> Maven-surefire-plugin</artifactid><version> 2.16</version><configuration><runorder>random</runorder></configuration></ Plugin><plugin><groupid>org.apache.maven.plugins</groupid><artifactid> Maven-failsafe-plugin</artifactid><version>2.16</version><executions><execution> <id>default-integration-test</id><goals><goal>integration-test</goal></goals     ></execution></executions></plugin> ......</plugins></build>

  

If you need eclipse's visible environment to see coverage, you can install a plugin in eclipse:eclemma

Reference: https://www.ibm.com/developerworks/cn/java/j-lo-jacoco/

Jenkins Yum Installation

Official website: http://jenkins-ci.org/

Reference: Https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions

sudo wget-o/etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.reposudo rpm--import https:// Jenkins-ci.org/redhat/jenkins-ci.org.keysudo Yum Install Jenkins

After the installation is complete, the configuration file is in:/etc/sysconfig/jenkins

Start

Service Jenkins Start

  

Sonar Yum Installation

Official website: http://www.sonarqube.org/

Reference: http://sonar-pkg.sourceforge.net/

sudo wget-o/etc/yum.repos.d/sonar.repo Http://downloads.sourceforge.net/project/sonar-pkg/rpm/sonar.repoyum Install sonar

Install default path in:/opt/sonar/

configuration files in: /opt/sonar/conf/ sonar.properties

(i use MySQL, MySQL installation is not much to say, so modify:sonar.properties )

Sonar.jdbc.username=sonarsonar.jdbc.password=sonarsonar.jdbc.url=jdbc:mysql://localhost:3306/sonar9?useunicode =true&characterencoding=utf8&rewritebatchedstatements=true&useconfigs=maxperformance

Start

Service Sonar start

The sonar service is started, access to http://192.168.0.240:9000, and support for MAVEN compiler configuration is required, and the Setting.xml content created under ~/.m2/is as follows:

<Settings>    <plugingroups>        <Plugingroup>Org.sonarsource.scanner.maven</Plugingroup>    </plugingroups>    <Profiles>        < Profile>            <ID>Sonar</ID>            <activation>                <Activebydefault>True</Activebydefault>            </activation>            <Properties>                <!--Optional URL to server. Default value is http://localhost:9000 -                <Sonar.host.url>http://192.168.0.240:9000</Sonar.host.url>                <!--sonar MySQL database:change to your MySQL info -         
<Sonar.jdbc.url>Jdbc:mysql://192.168.0.240:3306/sonar9</Sonar.jdbc.url> <Sonar.jdbc.driver>Com.mysql.jdbc.Driver</Sonar.jdbc.driver> <Sonar.jdbc.username>Sonar</Sonar.jdbc.username> <Sonar.jdbc.password>Sonar</Sonar.jdbc.password> </Properties> </ Profile> </Profiles></Settings>

MAVEN compiles at the following

MVN clean Install Sonar:sonar

At this point, the source generation analysis and submit the report to the sonar service up. Can visit http://192.168.0.240:9000 to see the report.

Nexus Private Maven Warehouse

Nexus is very effective for managing the underlying core common library of development, and some public libraries (such as Googlecode) that have been gfw walls.

Installation reference: http://blog.csdn.net/shenshen123jun/article/details/9084293

The Pom.xml configuration of the project is as follows:

Add distributionmanagement under the project node (for compilation and package upload to maven private warehouse), the following address is a reference, do not direct use:)

<distributionmanagement>        <Repository>            <ID>releases</ID>            <URL>Http://192.168.0.240:8060/nexus/content/repositories/releases</URL>        </Repository>        <snapshotrepository>            <ID>Snapshots</ID>            <URL>Http://192.168.0.240:8060/nexus/content/repositories/snapshots</URL>        </snapshotrepository>    </distributionmanagement>

Maven Package Upload command:

MVN Deploy

The previous step is still packed. The upload is unsuccessful because there is no identity authorization for the private warehouse, the private warehouse identity configuration reference: http://blog.csdn.net/hualom/article/details/8070320

The private ID password needs to be configured to the ~/.m2/settings.xml file of the development machine under the Settings node (~ Linux/unix The root directory of the current user under table, Windows is c:\users\{the current user name} ): as follows

<Servers>        <Server>                <ID>Snapshots</ID>                <username>Sing</username>                <Password>Password</Password>        </Server>         <Server>                <ID>releases</ID>                <username>Sing</username>                <Password>Password</Password>        </Server>   </Servers>

Pay attention to the color above, then execute MVN deploy should be fine.

Also in the uninterrupted update ...

Exploring the automation system of the architecture development of the EE 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.