Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

os.detected.classifier not set - os-maven-plugin and eclipse oxygen

I'm suffering the maven-protoc-plugin issue where os.detected.classifier isn't resolved causing eclipse to report an error in my pom.

I found this fix but I suspect that only works for older eclipse versions, there is no longer a <eclipse>/plugins folder in oxygen.

I've tried setting os.detected.classifier in eclipse.ini and windows environment variables to no avail.

Here's a clip of the pom for those that think it will help..

<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>

And part of the error...

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

Try downloading the file manually from the project website.
like image 555
TedTrippin Avatar asked Nov 24 '17 16:11

TedTrippin


3 Answers

In case it does not work for you instead of using the "extension" syntax you can register it as a plugin:

    <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>
like image 71
Massimo Avatar answered Nov 07 '22 17:11

Massimo


I know it is an old question, but I just ran into the same problem and found a solution that works for me.

Eclipse m2e does not process the maven os plugin/extension properly. There are a few suggestions available.

The one that worked for me with least effort was to add the plugin jar to the Eclipse dropins directory. On my mac is it is

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

The file is located on the maven repo here

Copy the file there, restart eclipse clean, and the os.detected.classifier will be properly expanded in m2e on eclipse.

like image 42
scott m gardner Avatar answered Nov 07 '22 19:11

scott m gardner


Add the following extension to your pom file: `

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

`

like image 2
user7742358 Avatar answered Nov 07 '22 18:11

user7742358