原文链接:为什么我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会是默认版本 而不是自己设置的版本?的更多相关文章

  1. eclipse 配置Maven问题解决办法:新建maven工程时报错:Could not resolve archetype org.apache.maven.archetypes .

    此文乃本作者配置maven,被其折磨n天,究极解决方案,好文要顶啊.欢迎致电: zhe-jiang.he@hp.com 首先各maven.archetypes下载地址: http://mirrors. ...

  2. 新建maven工程时pom.xml报错

    新建maven工程时,pom.xml报错:第一行报如下错误:multiple annotations found at this line后添加org.eclipse.m2e相关的plugin配置后, ...

  3. 【环境】新建Maven工程步骤及报错解决方法

    新建Maven工程步骤: 1.打开eclipse,File-New-Other-Maven-Maven project 点击Finish,即可创建一个Maven工程.Maven是内置的,不需要额外下载 ...

  4. 新建maven工程问题001

    这周一直在研究SpringMVC+Mybatis,有些心得,记录一下. Ⅰ:建maven遇到的问题. 1.1 新建maven时选中[Create a simple project]这样,后面[Pack ...

  5. Eclipse新建Maven工程——git篇

    1.eclipse,新建一个maven工程,步骤如下图: 右键新建的工程 发布前后工程对比如下: 2.发布为本地仓库 因为项目中,不是所有的文件,都需要提交到githut上,所以需要把不需要提交的问题 ...

  6. eclipse新建maven工程的各种坑

    尽量按照最后强烈推荐的那篇创建maven工程.  1.jsp文件头报错 2.xml配置文件头红叉 3.Archive for required library...blabla 4.pom依赖出错 5 ...

  7. 新建Maven工程

    这个如果不勾选那个Create a simple project也可以,但是创建完成后还需要修改工程的packaging为pom.还有如果不勾选,就选择maven-archetype-quicksta ...

  8. maven工程指定jdk版本,maven全局配置jdk的版本

  9. 解决新建maven工程没有web.xml的问题

    首先确定创建maven工程时选择的打包方式为 war 创建后如图所示没有web.xml文件以及相关文件夹,错误信息:缺少web.xml文件 解决方法: 右击maven项目,找到ProjectFacet ...

随机推荐

  1. ios7新增基础类库以及OC新特性

    新特性: Modules:用XCode5新建工程默认支持modules编译,老项目需在Build Settings里查找modules,找到的Enable Modules选项设置为YES. 对应新增语 ...

  2. 【Linux常用工具】03. Linux性能测试工具ab

    在Apache服务器的套件中,有一个叫做 ab (ApacheBench) 的工具. ApacheBench 主要是用来测试Apache服务器执行效率用的 ApacheBench 可以针对某个特定的 ...

  3. CardView官方教程

    Create Cards CardView extends the FrameLayout class and lets you show information inside cards that ...

  4. 【转载】Java垃圾回收内存清理相关(虚拟机书第三章),GC日志的理解,CPU时间、墙钟时间的介绍

    主要看<深入理解Java虚拟机> 第三张 P84 开始是垃圾收集相关. 1. 1960年诞生于MIT的Lisp是第一门采用垃圾回收的语言. 2. 程序计数器.虚拟机栈.本地方法栈3个区域随 ...

  5. Save output to a text file from Mac terminal

      Simply with output redirection: system_profiler > file.txt Basically, this will take the output ...

  6. bundle update: env: ruby_executable_hooks: No such file or directory

    please open a bug here: https://github.com/mpapis/executable-hooks/issues as a temporary fix try: rv ...

  7. bzoj2788

    明显是一个差分约束系统 对于第一种限制,其实就是x[a]+1<=x[b] x[b]-1<=x[a] 根据三角不等式很容易建图 但这题他比较奇怪,问的是X最多不同取值的个数 根据这张图的特殊 ...

  8. Java [Leetcode 189]Rotate Array

    题目描述: Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the ...

  9. 【转】Android 如何在Eclipse中查看Android API源码 及 support包源码

    原文网址:http://blog.csdn.net/vipzjyno1/article/details/22954775 当我们阅读android API开发文档时候,上面的每个类,以及类的各个方法都 ...

  10. c# List<int> 转 string 以及 string [] 转 List<int>

    List<int> 转 string : list<int>: 1,2,3,4,5,6,7  转换成字符串:“1,2,3,4,5,6,7” List<int> li ...