【转】新建maven工程为什么jdk会是默认版本 而不是自己设置的版本?
2016-02-28 09:59
405 查看
原文链接:为什么我eclipse新建项目的时候默认的是JRE1.5?
修改Maven中conf目录里的setting.xml文件内容,加上如下内容:
修改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>
相关文章推荐
- XFire+Spring整合构建Web Service的框架搭建实例代码下载
- Static Class及静态内部类和非静态内部类的不同
- java多线程学习(一)
- 【leetcode】【17】Letter Combinations of a Phone Number
- java基础总结(五)
- NLPIR分词工具的使用(java环境下)
- 【leetcode】【16】3Sum Closest
- java 文件
- Java多线程共享变量控制
- Java编程中字节流与字符流IO操作示例
- Java关键字合集
- java设计模式之策略模式
- JVM学习(4)——全面总结Java的GC算法和回收机制
- java打印可对齐的任意层数的杨辉三角形
- android imageView 获取指定名字的图片、从MyEclipse服务器下载图片
- spring IOC加载流程
- Java调用ffmpeg进行视频转码
- java并发包concurrent翻译及源码分析之:ReadWriteLock
- java38.Socket通信------使用ServerSocket建立聊天服务器---2
- 基于Eclipse的Android开发(一)——创建第一个Android项目