【问题标题】:Maven Eclipse plugin - classpath entries for each?Maven Eclipse 插件 - 每个的类路径条目?
【发布时间】:2014-04-25 18:49:53
【问题描述】:

运行 maven Eclipse 插件后,我的 .classpath 包含所有依赖项,如下所示:

  <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar"/>

有没有办法让它只包含 maven 类路径容器,像这样?

<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    <attributes>
        <attribute name="maven.pomderived" value="true"/>
    </attributes>
</classpathentry>

【问题讨论】:

    标签: eclipse maven maven-eclipse-plugin


    【解决方案1】:

    Eclipse m2e 插件的重点是您不必担心 Eclipse 类路径 - m2e 会自动处理包含在您的 pom.xml 中列出的依赖项。 瞧!

    其实建议你不要在使用pom.xml的时候弄乱项目的classpath。

    【讨论】:

    • 嗯,是的。似乎 Eclipse 插件可能已被弃用,或者至少应该被弃用?
    • 不,m2e 插件非常活跃,并且包含在最新的 eclipse 下载中。你只需要激活它。最重要的是,它应该让生活更简单、更轻松——如果没有,那就有问题了!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    相关资源
    最近更新 更多