maven
maven home M2_HOME
maven path
maven main test
main java
test java
mvn -v
mvn compile
mvn test
mvn clean
mvn package
mvn install
mvn setting.xml
mvn central repositroy maven moudle builder
http://repo.maven.apache.org/maven2
mvn archetype:generate
http://mvnrepository.com/search?q=log4j
level
compile 默认 编译 打包 都会加入
provided 编译 测试 使用, 打包不用
system
test 测试范围有效,编译 打包 不用.不会传递
import
runtime 运行时候依赖,编译时候不依赖 jdbc driver
web servlet-api
依赖级别相同
A---L1 直接依赖
B---L2 直接依赖
C---A , B谁在前面,就依赖谁。 间接依赖
依赖级别不同
近的优先, 最近的就是直接写入pom.xml
排除包写法
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>xxxx</groupId>
<artifactId>xxxx</artifactId>
</exclusion>
</exclusions>
</dependency>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.1.6.v20100715</version>
<configuration>
<systemProperties>
<systemProperty>
<name>spring.profiles.active</name>
<value>development</value>
</systemProperty>
</systemProperties>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
<!-- <defaultsDescriptor>src/main/resources/web.xml</defaultsDescriptor> -->
</webAppConfig>
<scanIntervalSeconds>600</scanIntervalSeconds>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8088</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-xmls</id>
<phase>process-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.ftl</include>
<include>**/*.java</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<testResources>
<testResource>
<directory>src/main/java</directory>
<includes>
<include>**/*.ftl</include>
</includes>
</testResource>
<testResource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
</testResources>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-xmls</id>
<phase>process-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.ftl</include>
<include>**/*.java</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
maven1
猜你喜欢
转载自fypop.iteye.com/blog/2113919
今日推荐
周排行