Configuration of Maven managed plug-ins in Eclipse (vi)

Source: Internet
Author: User
Tags rar create database


Pom in the parent

  <build> <pluginManagement> <plugins> <plugin> <groupid>org.apache.maven. Plugins</groupid> <artifactId>maven-source-plugin</artifactId> <version>2.1 .2</version> <executions> <execution> <phase>package< 
	       	    /phase> <goals><goal>jar-no-fork</goal></goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plu Gins</groupid> <artifactId>maven-rar-plugin</artifactId> <version>2.2</vers
        				ion> <executions> <execution> <phase>package</phase>
  			<goals><goal>rar</goal></goals> </execution> </executions>
  			
</plugin>  			<plugin> <groupId>org.codehaus.mojo</groupId> <artifactid>sql-maven-plugin&lt 
       					;/artifactid> <version>1.5</version> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> &L t;version>5.1.18</version> </dependency> </dependencies> <configura
			          Tion> <driver>${mysql.driver}</driver> <url>${mysql.url}</url>
			          <username>${mysql.username}</username> <password>${mysql.password}</password>
       			<sqlCommand> CREATE DATABASE IF not EXISTS maven_test </sqlCommand> </configuration> <executions> <execution> <phase& Gt;package</phase>
       					<goals> <goal>execute</goal> </goals> </execut ion> </executions> </plugin> </plugins> </pluginManagement> </build& Gt

Called in the module:

  <build> <finalName>user-web</finalName> <plugins> <plugin> <gro Upid>org.apache.maven.plugins</groupid> <artifactId>maven-war-plugin</artifactId> & Lt;version>2.2</version> <configuration> <warName>hello</warName> &
		  lt;/configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <scanintervalseconds>10&
		    lt;/scanintervalseconds> <webApp> <contextPath>/kk</contextPath> </webApp>
		          <connectors> <connector implementation= "Org.eclipse.jetty.server.nio.SelectChannelConnector" > <port>8787</port> <maxIdleTime>60000</maxIdleTime> </connector&
		     Gt </connectors> </configuration> </plugin> </plugins> </build> 

Enquiry Address: http://maven.apache.org/plugins/index.html

Common plugins: http://blog.163.com/lizhe_163/blog/static/6733560820119584353752/

Plug-ins used in our project; The first is to prevent JDK version problems, and the second is a question about test testing

    <build>
        <plugins>
            <plugin>
                <groupid>org.apache.maven.plugins</groupid >
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source >1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId> maven-surefire-plugin</artifactid>
                <configuration>
                    <skip>true</skip>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>
        </plugins>
        <defaultGoal>package</defaultGoal>
    </build>


Related Article

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.