Create a maven project in eclipse (2), eclipsemaven
This blog post continues with the previous blog post eclipse's new maven Project (1), which is not included in the article.
First, follow the previous blog post to create a maven project. After a series of operations, an error will be reported after the project is refreshed:
Don't worry, you can solve it.
Right-click the project and select:
After upgrading the maven project, you can see that the error is fixed and there is no Red Cross prompt.
After each maven project is upgraded, the jdk version of the project will change to version 1.5. In fact, you can set it only in pom. add the following code to the xml file to update the maven project without the need to manually adjust the jdk version.
1 <! -- Source code directory, plug-in management, and other configurations --> 2 <build> 3 <finalName> MavenSpringMVC </finalName> 4 <plugins> 5 <plugin> 6 <groupId> org. apache. maven. plugins </groupId> 7 <artifactId> maven-compiler-plugin </artifactId> 8 <version> 3.3 </version> 9 <configuration> 10 <! -- Specify the source and target versions --> 11 <! -- Source specifies the version of the compiler used to compile the java source code --> 12 <source> 1.7 </source> 13 <! -- The class file generated by target is compatible with the virtual machine of the specified version. --> 14 <target> 1.7 </target> 15 </configuration> 16 </plugin> 17 </ plugins> 18 </build>
The added location is:
In this way, you don't have to worry about manually adjusting the jdk version of the maven project every time you update the maven project.
Please indicate the source for reprinting. Thank you.