标签:
将Maven的Java Project修改为Web Project关键是需要了解Eclipse和MyEclipse的工程中如下文件.classpath和.project和.mymetadata含义和作用。
.project文件,本文主题将Maven的Java Project改为Web Project,关键是如下配置:
<?xml version=”1.0”encoding=”UTF-8”?>.classpath文件详细描述:
<?xml version=”1.0”encoding=”UTF-8”?>
<classpath>
<!-- 源码目录 -->
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<!-- JDK运行时容器 -->
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_20"/>
<!-- 引用Maven相关jar包 -->
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<!-- 编译后输出class目录 -->
<classpathentry kind="output" path="target/classes"/>
</classpath>
对于myeclipse工程多了一个.mymetadata文件:
<?xml version=”1.0”encoding=”UTF-8”?>
将Maven的Java Project修改为Web Project
标签:
原文地址:http://blog.csdn.net/sunitjy/article/details/42673853