读书人

maven jdk版本 编译有关问题

发布时间: 2013-03-12 11:19:35 作者: rapoo

maven jdk版本 编译问题
<!-- 待聚合模块 --> <modules> <module>../xxx-common</module> <module>../xxx-web</module> </modules> <!-- 配置部署的远程仓库 <distributionManagement> <snapshotRepository> <id>nexus-snapshots</id> <name>nexus distribution snapshot repository</name> <url>http://10.78.68.122:9090/nexus-2.1.1/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> --> <!-- 有的人会报错,找不到tools.jar --> <dependencyManagement> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.6.0</version> <scope>system</scope> <systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> </dependencies> </dependencyManagement> <build> <pluginManagement><plugins> <!-- 使用maven的编译插件 使maven能够编译1.5以上 --><plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> <source>1.6</source> <target>1.6</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin></plugins> </pluginManagement> </build></project>?
xxx-common-->基础工程 , 公共的代码

?
xxx-web-->web工程 放置里公共的配置文件,比如struts.xml、ssoconfig.properties等,起到聚合的作用, 即把所有的web项目,打成最终的war包
?
其他工程是修改~/.m2/repository目录下settings.xml文件,添加一个profile,内容如下:

?

读书人网 >Web前端

热点推荐