maven 使用 问题记录
2014-07-24 12:00
1196 查看
Java compiler level does not match the version of the installed Java project facet
Assuming that you are using the m2e plugin in Eclipse, you'll need to specify thesourceand
targetversions as 1.6 for
maven-compiler-plugin. m2e uses these values to determine the project's Java compiler level. A snippet of the POM is shown below:
<build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build>
Alternatively, you can specify the
maven.compiler.sourceand
maven.compiler.targetproperties with values of 1.6, that happen to be the equivalent:
<properties> <maven.compiler.target>1.6</maven.compiler.target> <maven.compiler.source>1.6</maven.compiler.source> </properties>
http://stackoverflow.com/questions/7715260/java-compiler-level-does-not-match-the-version-of-the-installed-java-project-fac
在POM 4中,<dependency>中还引入了<scope>,它主要管理依赖的部署。
* compile,缺省值,适用于所有阶段,会随着项目一起发布。
* provided,类似compile,期望JDK、容器或使用者会提供这个依赖。如servlet.jar。
* runtime,只在运行时使用,如JDBC驱动,适用运行和测试阶段。
* test,只在测试时使用,用于编译和运行测试代码。不会随项目发布。
* system,类似provided,需要显式提供包含依赖的jar,Maven不会在Repository中查找它。
官方文档: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
Maven编译打包时如何忽略测试用例
如果想跳过测试阶段,可用:mvn package -DskipTests
想临时性跳过测试代码的编译,可用:
mvn package -Dmaven.test.skip=true
maven.test.skip同时控制maven-compiler-plugin和maven-surefire-plugin两个插件的行为,即跳过编译,又跳过测试。
http://cwj158.iteye.com/blog/1528537
Maven最佳实践:划分模块 http://juvenshun.iteye.com/blog/305865
相关文章推荐
- Maven使用笔记(七)Maven使用问题记录Ⅰ
- maven 使用问题记录
- Idea使用Maven创建多模块SpringBoot项目问题记录
- myeclipse里工程的jdk使用的1.7版本,其中java compiler最高只能选到1.6的问题(在maven工程中出现的问题) -- 记录
- maven 使用记录及问题解决
- maven使用以及遇到的一些问题记录
- 使用maven管理项目的一些问题处理记录
- maven使用问题记录
- 初使用maven遇到各种问题记录
- [错误记录]关于指针传递获得数据使用错误问题....
- ado.net 操作excel 问题记录 -- 操作必须使用一个可更新的查询
- 使用CsV格式的CDR记录碰到的一个怪问题的解决
- oracle使用小技巧--解决按号单排序和横向记录拼字段问题
- 使用存储过程中的虚拟表解决同时从几个数据库服务器中读取记录的问题
- Oracle数据库使用遇到问题记录
- Hibernate使用count(*)取得表中记录总数(跨Hibernate3.x版本问题)(转)
- [记录]使用sscanf_s遇到的问题
- 使用maven-jetty-plugin启动JBoss是遇到的问题。
- 关于Hibernate中fatch=eager的bag集合(一个java List)使用Criteria查询出现重复记录的问题
- Oracle存储过程中使用记录类型注意的问题