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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM