`

maven plugin

阅读更多

<!--core plugins-->

<!--clean working directory-->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>

<!--java code resources-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>

<!--java code compiler-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
        <version>2.4</version>
        <configuration>
            <encoding>${project.build.sourceEncoding}</encoding>
            <source>${jdkVersion}</source>
            <target>${jdkVersion}</target>
</configuration>
</plugin>

<!--java code test-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<!--跳过测试-->
<skipTests>true</skipTests>
        </configuration>
</plugin>

<!--javadoc -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
        <configuration>
            <author>${developer.name}</author>
            <charset>${project.build.sourceEncoding}</charset>
            <encoding>${project.build.sourceEncoding}</encoding>
            <version>${project.version}</version>
            <show>private</show>
                <tagletArtifacts>
                    <tagletArtifact>
                        <groupId>org.apache.maven.plugin-tools</groupId>
                        <artifactId>maven-plugin-tools-javadoc</artifactId>
                        <version>3.2</version>
</tagletArtifact>
                </tagletArtifacts>
        </configuration>           
</plugin>

<!--jetty plugin-->
<plugin>
<groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
<version>8.1.0.v20120127</version>
    <configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<webApp>
<contextPath>/${project.artifactId}</contextPath>
        </webApp>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9021</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>

<!--tomcat7-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<path>/${project.artifactId}</path>
<port>9051</port>
</configuration>
</plugin>

<!--webapps cargo-->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.hostname>${hostname}</cargo.hostname>
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
<cargo.remote.username>${username}</cargo.remote.username>
<cargo.remote.password>${password}</cargo.remote.password>
<cargo.tomcat.manager.url>http://${hostname}:${servlet.port}/manager/html</cargo.tomcat.manager.url>
</properties>
</configuration>
<deployer>
<type>remote</type>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<pingURL>http://${hostname}:${servlet.port}/${project.artifactId}/login</pingURL>
<properties>
<context>${project.artifactId}</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>

clean package cargo:deployer-redeploy

<!-package jar 依赖包打源码合并到一个jar包->

<plugin>

<artifactId>maven-assembly-plugin</artifactId>

<configuration>

<appendAssemblyId>false</appendAssemblyId>

<descriptorRefs>

<descriptorRef>jar-with-dependencies</descriptorRef>

</descriptorRefs>

 

<archive>

<manifest>

<mainClass>com.*.main.Start</mainClass>

</manifest>

</archive>

</configuration>

<executions>

<execution>

<id>make-assembly</id>

<phase>package</phase>

<goals>

<goal>assembly</goal>

            </goals>

</execution>

</executions>

</plugin>

 

<!--install source 安装jar包同时安装源码-->

<plugin>

     <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-source-plugin</artifactId>

                <executions>

                    <execution>

                        <id>attach-sources</id>

                        <goals>

                            <goal>jar</goal>

                        </goals>

                    </execution>

                </executions>

</plugin>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics