Maven项目结构

maven项目主体结构:

 

另外,Eclipse新建项目时会生成.project、.classpath及.settings目录下的文件,这些文件用于描述一个Eclipse项目,

接下来做一个简要的解析:

.project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <!-- 项目名称 -->
    <name>aaa</name>
    <!-- 此项目注释 -->
    <comment></comment>
    <!-- 引用的项目 -->
    <projects>
    </projects>
    <!-- 一系列构建指令 -->
    <buildSpec>
        <!-- 构建指令 -->
        <buildCommand>
            <!-- 指令名称 -->
            <name>org.eclipse.jdt.core.javabuilder</name>
            <!-- 参数 -->
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.m2e.core.maven2Builder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.m2e.core.maven2Nature</nature>
    </natures>
</projectDescription>

 

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <!-- kind="src"表明这是针对源文件的处理,即src/main/java下的源文件编译到target/classes目录下 -->
    <classpathentry kind="src" output="target/classes" path="src/main/java">
        <attributes>
            <attribute name="optional" value="true"/>
            <!-- pom derived(衍生)表明项目由pom衍生而来,受maven管理 -->
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="src" output="target/test-classes" path="src/test/java">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <!-- kind="con"表明这是配置,此项目使用得JDK为J2SE-1.5 -->
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <!-- kind="output"表明这是输出,此项目一般输出到target/classes下 -->
    <classpathentry kind="output" path="target/classes"/>
</classpath>

 

.settings

.prefs属性文件

org.eclipse.jdt.core.prefs (java development tools)关于java编译的配置

org.eclipse.m2e.core.prefs 关于maven的配置

 

转载于:https://www.cnblogs.com/yanze/p/9475422.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值