Home  >  Article  >  Java  >  Solve problems that occur in maven projects

Solve problems that occur in maven projects

PHP中文网
PHP中文网Original
2017-06-20 16:28:521375browse

1, Open the newly created servlet file for example (hibernate.cfg.xml) and modify the header file to


"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration -3.0.dtd">

2. Open the .settings folder in the project directory

2.1Modify the project settings and open org.eclipse in the project.settings directory .jdt.core.prefs (open a tool such as NOTEPAD++)

Change 1.5 to 1.8, for example:

1 eclipse.preferences.version=12 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled3 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.84 org.eclipse.jdt.core.compiler.compliance=1.85 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error6 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error7 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning8 org.eclipse.jdt.core.compiler.source=1.8
View Code

2.2Open org.eclipse.wst.common.project.facet.core.xml

Change to , change Change to

##
1 <?xml version="1.0" encoding="UTF-8"?>2 <faceted-project>3   <fixed facet="wst.jsdt.web"/>4   <installed facet="jst.web" version="3.0"/>5   <installed facet="wst.jsdt.web" version="1.0"/>6   <installed facet="jboss.m2" version="1.0"/>7   <installed facet="java" version="1.8"/>8   <installed facet="jst.cdi" version="1.0"/>9 </faceted-project>
View Code

3,

Open the pom.xml file that stores dependencies, and modify the bottom

D5.22hotai

is

 1  <build> 2     <finalName>D5.22hotai</finalName> 3      <plugins>  
 4         <plugin>  
 5             <groupId>org.apache.maven.plugins</groupId>  
 6             <artifactId>maven-compiler-plugin</artifactId>  
 7             <version>3.3</version>  
 8             <configuration>  
 9                 <!-- 指定source和target的版本 -->                 
10                 <source>1.8</source>  
11                 <target>1.8</target>  
12             </configuration>  
13         </plugin>  
14     </plugins>  
15   </build>
View Code
4. Restart eclipse or right-click the project maven → Update Project...

The above is the detailed content of Solve problems that occur in maven projects. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn