idea编译修改jdk版本

由于项目需要,需要修改jdk的版本为1.8,这里记录一下修改的地方

1,项目的jdk版本

右键点击项目-> open module setting ->project,然后如图所示

2,在pom文件中配置source和target版本

            <!--制定编译版本-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

3,另外,在编译的可以去除某些包含文件,可以使用exclude来去除一些配置文件

            <!-- 打包时,排除不需要的配置文件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <excludes>
                        <exclude>src/main/resources/log4j.properties</exclude>
                        <exclude>src/main/resources/Personal-DB.properties</exclude>
                        <exclude>src/main/resources/Personal-GeneratorConfig.xml</exclude>
                        <exclude>src/main/resources/Personal-MybatisConfig.xml</exclude>
                        <exclude>src/main/resources/Personal-SpringDaoConfig.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>

 

posted @ 2017-03-01 13:38  凝荷  阅读(13274)  评论(0编辑  收藏  举报