【问题标题】:eclipse plugin maven generated jar does not contain classeseclipse插件maven生成的jar不包含类
【发布时间】:2014-01-14 11:43:53
【问题描述】:

我正在尝试将一个新的 eclipse 插件项目打包到一个遗留项目中,该项目生成 zip 和更新站点以安装在 eclipse 上。但是当我在新的 Eclipse 上安装插件时,我收到错误“插件 com.example 无法加载类”。 我在 zip 文件中查看了 jar 内部,并且 jar 不包含任何 .class 文件。只需 src 与 .java。

我正在使用 tycho maven 插件,用 maven 处理 eclipse 插件依赖关系。

添加到 pom.xml:

    <packaging>eclipse-plugin</packaging>

添加到父级的 pom.xml:

<modules>
    <module>com.example</module>    
</modules>

这是我的 build.properties

source.. = src/main/java/,\
src/main/resources
output.. = target/
bin.includes = META-INF/,\
.,\
plugin.xml,\
icons/,\
META-INF/lib/commons-codec.jar,\
META-INF/lib/commons-io.jar,\
META-INF/lib/commons-logging.jar,\
META-INF/lib/fluent-hc.jar,\
META-INF/lib/httpclient-cache.jar,\
META-INF/lib/httpclient.jar,\
META-INF/lib/httpmime.jar,\
META-INF/lib/resteasy-jaxb-provider.jar,\
META-INF/lib/resteasy-jaxrs.jar,\
META-INF/lib/resteasy-multipart-provider.jar,\
META-INF/lib/scannotation.jar,\
OSGI-INF/l10n/bundle.properties,\
OSGI-INF/,\
OSGI-INF/l10n/

【问题讨论】:

  • build.properties 使用 Maven?请发帖pom.xml
  • 泰谷从build.properties读取包装信息,所以这个文件的内容很重要。实际上缺少的是第谷和包装类型eclipse-plugin被使用。

标签: java eclipse maven eclipse-plugin tycho


【解决方案1】:

问题是我的源不在 src/main/java/ 和 src/main/resources 中。我的课程在 src/.

我只是将源更改为

source= src

现在正在工作:)

【讨论】:

    【解决方案2】:

    您不应该在 /libs 目录而不是 /META-INF/libs 中拥有外部库吗? 另外,如果您使用的是maven项目结构,生成的类不是/target/classes而不是/target吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-04
      • 2021-10-26
      • 2018-11-26
      • 1970-01-01
      • 2016-11-09
      • 2021-01-22
      • 2021-10-24
      • 1970-01-01
      相关资源
      最近更新 更多