• maven配置文件里改动默认jre


    方法一:打开%maven_home%confsetting.xml,仅仅会在新建项目时自己主动使用1.6的导入项目不会

    在<profiles>标签内加入�例如以下配置:

    <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>
    </profile>

    方法二:不同的项目使用不同的jre,pom.xml里加入�例如以下配置

    导入项目能够这样配置然后进行maven project update:

    <build>

        <plugins>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-compiler-plugin</artifactId>

                <configuration>

                    <source>1.8</source>

                    <target>1.8</target>

                </configuration>

            </plugin>

        </plugins>

    </build>


    修正maven-dependency-plugin不支持m2e的问题:

    <pluginManagement>  
        <plugins>  
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->  
            <plugin>  
                <groupId>org.eclipse.m2e</groupId>  
                <artifactId>lifecycle-mapping</artifactId>  
                <version>1.0.0</version>  
                <configuration>  
                    <lifecycleMappingMetadata>  
                        <pluginExecutions>  
                            <pluginExecution>  
                                <pluginExecutionFilter>  
                                    <groupId>  
                                        org.apache.maven.plugins  
                                    </groupId>  
                                    <artifactId>  
                                        maven-dependency-plugin  
                                    </artifactId>  
                                    <versionRange>  
                                        [2.0,)  
                                    </versionRange>  
                                    <goals>  
                                        <goal>unpack</goal>  
                                    </goals>  
                                </pluginExecutionFilter>  
                                <action>  
                                    <ignore></ignore>  
                                </action>  
                            </pluginExecution>  
                        </pluginExecutions>  
                    </lifecycleMappingMetadata>  
                </configuration>  
            </plugin>  
        </plugins>  
    </pluginManagement>  

  • 相关阅读:
    常春藤之路,从幼儿园开始走起
    常青藤零距离
    web-service
    WebService到底是什么?
    How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellij
    浏览器核心说明
    万维网
    js和jquery获取span里面的值
    TPshop学习
    sphinx文档
  • 原文地址:https://www.cnblogs.com/hrhguanli/p/4077103.html
Copyright © 2020-2023  润新知