【问题标题】:os.detected.classifier not set - os-maven-plugin and eclipse oxygenos.detected.classifier 未设置 - os-maven-plugin 和 Eclipse 氧气
【发布时间】:2023-03-09 17:09:01
【问题描述】:

我遇到了maven-protoc-plugin 问题,其中os.detected.classifier 未解决导致eclipse 在我的pom.xml 中报告错误。

我找到了this fix,但我怀疑它只适用于较旧的 eclipse 版本,氧气中不再有 <eclipse>/plugins 文件夹。

我尝试在 eclipse.ini 和 windows 环境变量中设置os.detected.classifier 无济于事。

这是一个 pom 的剪辑,适合那些认为它会有所帮助的人..

<build>
    <extensions>
        <extension>
            <groupId>kr.motd.maven</groupId>
            <artifactId>os-maven-plugin</artifactId>
            <version>1.3.0.Final</version>
        </extension>
    </extensions>             
    <plugins>
         <plugin>
            <groupId>com.google.protobuf.tools</groupId>
            <artifactId>maven-protoc-plugin</artifactId>
            <version>0.4.3</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>

还有部分错误...

Missing:
----------
1) com.google.protobuf:protoc:exe:${os.detected.classifier}:2.6.1

Try downloading the file manually from the project website.

【问题讨论】:

  • 我今天仍然遇到同样的问题。

标签: java eclipse maven eclipse-plugin


【解决方案1】:

如果它不适合您,而不是使用“扩展”语法,您可以将其注册为插件:

    <plugin>
      <groupId>kr.motd.maven</groupId>
      <artifactId>os-maven-plugin</artifactId>
      <version>1.6.2</version>
      <executions>
        <execution>
          <phase>initialize</phase>
          <goals>
            <goal>detect</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

【讨论】:

【解决方案2】:

我知道这是一个老问题,但我遇到了同样的问题并找到了适合我的解决方案。

Eclipse m2e 无法正确处理 maven os 插件/扩展。有一些可用的建议。

对我来说最省力的方法是将插件 jar 添加到 Eclipse dropins 目录。在我的 Mac 上是

~/eclipse/java-2018-12/Eclipse.app/Contents/Eclipse/dropins

文件位于maven repo here

将文件复制到那里,重新启动eclipse clean,os.detected.classifier将在eclipse上的m2e中正确展开。

【讨论】:

  • 为我工作谢谢。我的路径是 ~/eclipse/dropins
  • 类似地为我工作,但我的情况是它应该添加到文件夹 plugins,如何找到路径 About Eclipse -> Installation Details -> Configuration -> - -launcher.library ,在此处获取您的版本 jar:repo1.maven.org/maven2/kr/motd/maven/os-maven-plugin ...
【解决方案3】:

将以下扩展名添加到您的 pom 文件中: `

<project>
  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.6.1</version>
      </extension>
    </extensions>
  </build>
</project>

`

【讨论】:

    猜你喜欢
    • 2018-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-19
    • 2018-04-09
    • 1970-01-01
    相关资源
    最近更新 更多