【转】新建maven工程为什么jdk会是默认版本 而不是自己设置的版本?
原文链接:为什么我eclipse新建项目的时候默认的是JRE1.5?
修改Maven中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.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</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> -->
</profiles>
【转】新建maven工程为什么jdk会是默认版本 而不是自己设置的版本?的更多相关文章
- eclipse 配置Maven问题解决办法:新建maven工程时报错:Could not resolve archetype org.apache.maven.archetypes .
此文乃本作者配置maven,被其折磨n天,究极解决方案,好文要顶啊.欢迎致电: zhe-jiang.he@hp.com 首先各maven.archetypes下载地址: http://mirrors. ...
- 新建maven工程时pom.xml报错
新建maven工程时,pom.xml报错:第一行报如下错误:multiple annotations found at this line后添加org.eclipse.m2e相关的plugin配置后, ...
- 【环境】新建Maven工程步骤及报错解决方法
新建Maven工程步骤: 1.打开eclipse,File-New-Other-Maven-Maven project 点击Finish,即可创建一个Maven工程.Maven是内置的,不需要额外下载 ...
- 新建maven工程问题001
这周一直在研究SpringMVC+Mybatis,有些心得,记录一下. Ⅰ:建maven遇到的问题. 1.1 新建maven时选中[Create a simple project]这样,后面[Pack ...
- Eclipse新建Maven工程——git篇
1.eclipse,新建一个maven工程,步骤如下图: 右键新建的工程 发布前后工程对比如下: 2.发布为本地仓库 因为项目中,不是所有的文件,都需要提交到githut上,所以需要把不需要提交的问题 ...
- eclipse新建maven工程的各种坑
尽量按照最后强烈推荐的那篇创建maven工程. 1.jsp文件头报错 2.xml配置文件头红叉 3.Archive for required library...blabla 4.pom依赖出错 5 ...
- 新建Maven工程
这个如果不勾选那个Create a simple project也可以,但是创建完成后还需要修改工程的packaging为pom.还有如果不勾选,就选择maven-archetype-quicksta ...
- maven工程指定jdk版本,maven全局配置jdk的版本
- 解决新建maven工程没有web.xml的问题
首先确定创建maven工程时选择的打包方式为 war 创建后如图所示没有web.xml文件以及相关文件夹,错误信息:缺少web.xml文件 解决方法: 右击maven项目,找到ProjectFacet ...
随机推荐
- Image.FrameDimensionsList 属性-----具体使用案例2
图片的拆分 1.保存png图片 using System; using System.Collections.Generic;using System.ComponentModel;using Sys ...
- 爬虫技术(五)-- 模拟简单浏览器(附c#代码)
由于最近在做毕业设计,需要用到一些简单的浏览器功能,于是学习了一下,顺便写篇博客~~大牛请勿喷,菜鸟练练手~ 实现界面如下:(简单朴素版@_@||) button_go实现如下: private vo ...
- disable-linux-firewall-under-centos-rhel-fedora
http://www.cyberciti.biz/faq/disable-linux-firewall-under-centos-rhel-fedora/
- poj 1177 Picture (线段树 扫描线 离散化 矩形周长并)
题目链接 题意:给出n个矩形,每个矩形给左下 和 右上的坐标,求围成的周长的长度. 分析: 首先感谢大神的博客,最近做题经常看大神的博客:http://www.cnblogs.com/kuangbin ...
- svn url does not contain valid patch
想把项目上传到svn上,由于误点击了apply patch.所以出现下面的错误. 正确做法是在项目上右击找到Team----share Project 如图: 点击share project后出现如图 ...
- iOS开发:告诉git不要跟踪UserInterfaceState.xcuserstate
在xcode中使用git管理项目的技巧: 在多人协作开发的时候,每个开发者都会在项目中的某个目录生成一个 UserInterfaceState.xcuserstate 文件,这个文件大概每5s会刷新一 ...
- 自学了三天的SeaJs学习,解决了前端的一些问题,与小伙伴们一起分享一下!
我为什么学习SeaJs? [第一]:为了解决项目中资源文件版本号的问题,以及打包压缩合并等问题. [第二]:好奇心和求知欲.[我发现很多知名网站也都在使用(qq空间, msn, 淘宝等等),而且 Se ...
- php复制目录及文件
<?php /* 复制目录 */ function copydir($dirsrc,$dirto){ if(is_file($dirto)){ echo "目标不是目录不能创建&quo ...
- uestc 1721 吴神,人类的希望
// 将n个相同的球放进m个盒子 盒子不为空的方法总数// dp[i][j] 表示i个盒子 j个球的方法总数// 递推关系 dp[i][j]=dp[i-1][j-1]+d[i][j-i]// a. i ...
- 【转】Git 少用 Pull 多用 Fetch 和 Merge
原文网址:http://www.cnblogs.com/flying_bat/p/3408634.html 本文有点长而且有点乱,但就像Mark Twain Blaise Pascal的笑话里说的那样 ...