1、导入Maven项目出错 org.apache.maven:maven-archiver:pom:2.5…
这个问题是我再将Maven项目从笔记本拷到台式机的时候出现的问题,原因是连不上http://repo1.maven.org/maven2这个仓库,在pom.xml文件加入如下配置
1. <repositories>
2. <repository>
3. <snapshots>
4. <enabled>false</enabled>
5. </snapshots>
6. <id>central</id>
7. <name>Maven Repository Switchboard</name>
8. <url>http://repo2.maven.org/maven2</url>
9. </repository>
10. </repositories>
maven-clean,然后maven-update,ok!
2、Cannot change version of project facet Dynamic web module to 2.5
这个是我从网上下载demo的时候,出现的问题,原因是catalog比较老,用的servlet还是2.3的,按照下面步骤就可以解决
1.把Servlet改成2.5,打开项目的web.xml,改之前:
1. <!DOCTYPE web-app PUBLIC
2. "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
3. "http://java.sun.com/dtd/web-app_2_3.dtd" >
4.
5. <web-app>
6. <display-name>Archetype Created Web Application</display-name>
7. </web-app>
改后:
1. <?xml version="1.0" encoding="UTF-8"?>
2. <web-app version="2.5"
3. xmlns="http://java.sun.com/xml/ns/javaee"
4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
6. http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
7.
8. <display-name>Archetype Created Web Application</display-name>
9. </web-app>
2.修改项目的设置,在Navigator下打开项目.settings目录下的org.eclipse.jdt.core.prefs
1. eclipse.preferences.version=1
2. org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3. org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
4. org.eclipse.jdt.core.compiler.compliance=1.5
5. org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6. org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7. org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
8. org.eclipse.jdt.core.compiler.source=1.5
把1.5改成1.6
1. eclipse.preferences.version=1
2. org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3. org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4. org.eclipse.jdt.core.compiler.compliance=1.6
5. org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6. org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7. org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
8. org.eclipse.jdt.core.compiler.source=1.6
打开org.eclipse.wst.common.component
1. <?xml version="1.0" encoding="UTF-8"?>
2. <project-modules id="moduleCoreId" project-version="1.5.0">
3. <wb-module deploy-name="test">
4. <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
5. <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
6. <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
7. <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
8. <property name="context-root" value="test"/>
9. <property name="java-output-path" value="/test/target/classes"/>
10. </wb-module>
11. </project-modules>
把project-version=”1.5.0”改成project-version=”1.6.0”
1. <?xml version="1.0" encoding="UTF-8"?>
2. <project-modules id="moduleCoreId" project-version="1.6.0">
3. <wb-module deploy-name="test">
4. <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
5. <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
6. <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
7. <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
8. <property name="context-root" value="test"/>
9. <property name="java-output-path" value="/test/target/classes"/>
10. </wb-module>
11. </project-modules>
打开org.eclipse.wst.common.project.facet.core.xml
1. <?xml version="1.0" encoding="UTF-8"?>
2. <faceted-project>
3. <fixed facet="wst.jsdt.web"/>
4. <installed facet="java" version="1.5"/>
5. <installed facet="jst.web" version="2.3"/>
6. <installed facet="wst.jsdt.web" version="1.0"/>
7. </faceted-project>
把改成,把 改成
1. <?xml version="1.0" encoding="UTF-8"?>
2. <faceted-project>
3. <fixed facet="wst.jsdt.web"/>
4. <installed facet="java" version="1.6"/>
5. <installed facet="jst.web" version="2.5"/>
6. <installed facet="wst.jsdt.web" version="1.0"/>
7. </faceted-project>
待续。。。。