使用eclipse-resource-api插件开发遍历maven项目的依赖罐

问题描述

我有一个Maven项目。我想遍历其依赖项jar项目并读取其中的一些属性文件。 使用eclipse资源api,我可以在工作区中获取IProject实例并访问其类路径文件。

Class-path具有以下结构。

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

我如何从中提取出实际的依赖罐位置?

我原本希望这样的事情

<classpath>
 <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
 <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar"/>
</classpath>

2。还是有比这更好的方法来以编程方式读取maven依赖罐?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)