maven编译设置pom.xml

Posted zipon

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven编译设置pom.xml相关的知识,希望对你有一定的参考价值。

 1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
 2   <modelVersion>4.0.0</modelVersion>  
 3   <groupId>com.bjhit.eranges</groupId>  
 4   <artifactId>nsaddpserver</artifactId>  
 5   <version>0.0.1-SNAPSHOT</version>  
 6   <packaging>war</packaging>  
 7   <name>nsaddpserver</name>  
 8     
 9    <url>http://maven.apache.org</url>  
10   
11     <properties>  
12         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
13     </properties>  
14   
15     <build>  
16         <plugins>  
17             <plugin>  
18                 <groupId>org.apache.maven.plugins</groupId>  
19                 <artifactId>maven-compiler-plugin</artifactId>  
20                 <configuration>  
21                     <source>1.6</source>  
22                     <target>1.6</target>  
23                     <encoding>UTF-8</encoding>  
24                 </configuration>  
25             </plugin>  
26               
27             <plugin>    
28                 <groupId>org.apache.maven.plugins</groupId>    
29                 <artifactId>maven-war-plugin</artifactId>    
30                 <version>2.1-alpha-1</version>    
31                 <configuration>     
32                     <webResources>    
33                         <resource>    
34                             <!-- 元配置文件的目录,相对于pom.xml文件的路径 -->    
35                             <directory>src/main/webapp/WEB-INF</directory>    
36                             <!-- 目标路径 -->    
37                             <targetPath>WEB-INF</targetPath>    
38                         </resource>    
39                     </webResources>    
40                 </configuration>    
41         </plugin>    
42           
43         </plugins>  
44     </build>  
45     <dependencies>  
46         <dependency>  
47             <groupId>junit</groupId>  
48             <artifactId>junit</artifactId>  
49             <version>4.10</version>  
50             <scope>test</scope>  
51         </dependency>  
52         <dependency>  
53             <groupId>com.bjhit.eranges</groupId>  
54             <artifactId>nsaddpapi</artifactId>  
55             <version>0.0.1-SNAPSHOT</version>  
56         </dependency>  
57         <dependency>  
58             <groupId>com.bjhit.eranges</groupId>  
59             <artifactId>nsaddp-common</artifactId>  
60             <version>0.0.1-SNAPSHOT</version>  
61         </dependency>  
62         <dependency>  
63             <groupId>com.bjhit.eranges</groupId>  
64             <artifactId>nsaddpprocess</artifactId>  
65             <version>0.0.1-SNAPSHOT</version>  
66         </dependency>  
67     </dependencies>  
68     <distributionManagement>  
69         <!--配置Maven部署至Nexus -->  
70         <repository>  
71             <id>nexus-releases</id>  
72             <name>Nexus Releases Repository</name>  
73             <url>http://maven.bjhit.com/nexus/content/repositories/releases/</url>  
74         </repository>  
75         <snapshotRepository>  
76             <id>nexus-snapshots</id>  
77             <name>Nexus Snapshots Repository</name>  
78             <url>http://maven.bjhit.com/nexus/content/repositories/snapshots/</url>  
79         </snapshotRepository>  
80     </distributionManagement>  
81       
82 </project>  

 

以上是关于maven编译设置pom.xml的主要内容,如果未能解决你的问题,请参考以下文章

运行maven pom.xml文件后编译环境变为jdk1.5

工程了没有gardle只有pom怎么编译

已有esclipse现成项目,怎么把MAVEN添加进去.添加个POM.XML文件 ,让他能进行打包. 求高手详解,解决后加分

maven上手

WSO2样本Maven pom.xml

Maven:POM.xml 中缺少工件 com.sun:tools:jar:1.6.0 编译时异常 [重复]