修改maven的默认JDK
- 在我们实际使用IDEA开发maven项目的时候,创建maven项目的默认版本是jdk1.5,当然我们可以通过其他手段去修改module的JDK版本,或JDK的编译级别等等,但是如果每次你都这样修改,那真的很麻烦,有没有一劳永逸的方法呢?
- 在conf/setting..xml文件中添加如下信息即可。
<profiles>
<!-- profile
| Specifies a set of introductions to the build process, to be activated using one or more of the
| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
| or the command line, profiles have to have an ID that is unique.
|
| An encouraged best practice for profile identification is to use a consistent naming convention
| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
| This will make it more intuitive to understand what the set of introduced profiles is attempting
| to accomplish, particularly when you only have a list of profile id's for debug.
|
| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
<profile>
<id>jdk-1.4</id>
<activation>
<jdk>1.4</jdk>
</activation>
<repositories>
<repository>
<id>jdk14</id>
<name>Repository for JDK 1.4 builds</name>
<url>http://www.myhost.com/maven/jdk14</url>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
</profile>
-->
<!--
| Here is another profile, activated by the system property 'target-env' with a value of 'dev',
| which provides a specific path to the Tomcat instance. To use this, your plugin configuration
| might hypothetically look like:
|
| ...
| <plugin>
| <groupId>org.myco.myplugins</groupId>
| <artifactId>myplugin</artifactId>
|
| <configuration>
| <tomcatLocation>${tomcatPath}</tomcatLocation>
| </configuration>
| </plugin>
| ...
|
| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
| anything, you could just leave off the <value/> inside the activation-property.
|
<profile>
<id>env-dev</id>
<activation>
<property>
<name>target-env</name>
<value>dev</value>
</property>
</activation>
<properties>
<tomcatPath>/path/to/tomcat/instance</tomcatPath>
</properties>
</profile>
-->
<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
修改maven的默认JDK的更多相关文章
- Java修改maven的默认jdk版本为1.7
Java修改maven的默认jdk版本 问题: 1.创建maven项目的时候,jdk版本是1.5版本,而自己安装的是1.7或者1.8版本. 2.每次右键项目名-maven->update pro ...
- 修改maven的默认jdk版本
问题: 创建maven项目的时候,jdk版本默认使用的是1.5版本. 解决: 1.修改maven的settings.xml文件,添加如下: <profile> <id>jdk- ...
- 修改Maven项目默认JDK版本
问题: 1.创建maven项目的时候,jdk版本是1.5版本,而自己安装的是1.7或者1.8版本. 2.每次右键项目名-maven->update project 时候,项目jdk版本变了,变回 ...
- 如何修改maven的默认jdk版本
问题: 1.创建maven项目的时候,jdk版本是1.5版本,而自己安装的是1.7或者1.8版本. 2.每次右键项目名-maven->update project 时候,项目jdk版本变了,变回 ...
- (转)如何修改maven的默认jdk版本
背景:在maven的配置文件中配置编译的jdk插件,就不需要在eclipse中进行重新的指定了. 问题 1.创建maven项目的时候,jdk版本是1.5版本,而自己安装的是1.7或者1.8版本. 2. ...
- maven配置默认jdk版本
在maven的默认配置中,对于jdk的配置是1.4版本,那么创建/导入maven工程过程中,工程中未指定jdk版本. 对工程进行maven的update,就会出现工程依赖的JRE System Lib ...
- eclipse 修改maven项目的jdk版本
eclipse 修改maven项目的jdk版本 CreationTime--2018年6月8日10点29分 Author:Marydon 1.情景展示 jdk版本太低,如何修改 2.错误方式 第一 ...
- Eclipse 中 Maven 项目默认JDK版本为1.5 的解决方法
在 Eclipse 中 Maven project 的默认 JDK 版本是 1.5, 如果不在 settings.xml 或者 pom.xml 中显示的指出 JDK 版本,每次 右键项目--> ...
- myeclipse中修改maven的默认仓库位置
1.本地需要安装Maven.这里假设安装在D:\Program Files\apache-maven-2.2.1 2.修改本地maven库的路径:在D:\Program Files\ap ...
随机推荐
- 手机app微信支付后台处理流程
第一步:客户在手机app确认订单,提交订单后,app将订单详情传给后台,后台将订单存入数据库,将存入数据库的id返回给app. 第二步:这时候手机端app会让客户选择哪种付款方式,我们做的是微信,所以 ...
- C++ 宏定义#define 中##的使用
在C++的宏定义中,符号##一般是用于连接,包括参数的连接,参数与标识符的连接等,然后形成一个新的标识符. 下面举几个例子来进行说明. eg1: #define ADD(a,b) a##b #defi ...
- Lniux下安装mysql----编译版
####安装mysql-5.7.10rpm -e --nodeps mysqlrpm -e mysqlclient10useradd -g mysql -s /sbin/nologininstall_ ...
- 官方Tomcat镜像Dockerfile分析及镜像使用
官方Tomcat镜像 地址:https://hub.docker.com/_/tomcat/ 镜像的Full Description中,我们可以得到许多信息,这里简单介绍下: Supported ta ...
- JVM常见垃圾回收算法
jdk1.7.0_79 众所周知,Java是一门不用程序员手动管理内存的语言,全靠JVM自动管理内存,既然是自动管理,那必然有一个垃圾内存的回收机制或者回收算法.本文将介绍几种常见的垃圾回收(下文简称 ...
- jsp,2016.11.28
1,在jsp中要关联到js的时候就要导入js才可以调用到js <!-- 导入地区的js --> <script type="text/javascript" sr ...
- UVa455 Periodic String 的wronganswer问题探讨,以及AC的新思路
题目的意思是一个字符串有某个长度为k的字符串通过不断重复形成的,而k被称为该字符串的周期.而我们所要做的是找出该字符串的最小周期. input The first line is an integer ...
- 十年过去了,各位 .net 兄弟还好吗
时间是最无情的,一下子就毕业10年了.很久没有发发牢骚了,今天突然想发一下.看过我文章喷过的知道,我一般都是散文,看完不知道我写了什么,形散而神不散嘛. 十年了,不好意思,没像网上说的标准一样,做管理 ...
- HDU 2203 亲和串(KMP)
题目网址:http://acm.hdu.edu.cn/showproblem.php?pid=2203 题目: 亲和串 Time Limit: 3000/1000 MS (Java/Others) ...
- 还在为画“类Word文档报表”而发愁吗?
欢迎大家持续关注葡萄城控件技术团队博客,更多更好的原创文章尽在这里~~ Word 是非常强大的文档编辑工具,一些行业制式文档都是使用Word来创建的,像教育行业的申请表,履历表,审批表等,像石油业的 ...