xolstice / protobuf-maven-plugin

Maven Plugin that executes the Protocol Buffers (protoc) compiler
https://www.xolstice.org/protobuf-maven-plugin/
Other
232 stars 76 forks source link

Eclipse - Multiple annotations found at this line: - Missing: ---------- 1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 #18

Closed paulvi closed 7 years ago

paulvi commented 7 years ago

Similar to https://github.com/xolstice/protobuf-maven-plugin/issues/10#issuecomment-252944822 raised by @ccleve in a test project https://github.com/paulvi/com.example.grpc.maven

To reproduce press Alt+F5 that is call Maven -> Update Project...
That marks pom.xml and and the project into red.

image

Multiple annotations found at this line:
    - Missing: ---------- 1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 Try downloading the file 
     manually from the project website. Then, install it using the command: mvn install:install-file -
     DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -
     Dpackaging=exe -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn 
     deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.1.0 -Dclassifier=$
     {os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT 2) com.google.protobuf:protoc:exe:$
     {os.detected.classifier}:3.1.0 ---------- 1 required artifact is missing. for artifact: 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT from the specified remote repositories: central 
     (https://repo.maven.apache.org/maven2, releases=true, snapshots=false) (org.xolstice.maven.plugins:protobuf-maven-
     plugin:0.5.0:compile-custom:default:generate-sources) org.apache.maven.plugin.MojoExecutionException: Missing: 
     ---------- 1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 Try downloading the file manually from the 
     project website. Then, install it using the command: mvn install:install-file -DgroupId=com.google.protobuf -
     DartifactId=protoc -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file 
     Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -
     DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -
     Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT 2) com.google.protobuf:protoc:exe:$
     {os.detected.classifier}:3.1.0 ---------- 1 required artifact is missing. for artifact: 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT from the specified remote repositories: central 
     (https://repo.maven.apache.org/maven2, releases=true, snapshots=false) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact(AbstractProtocMojo.java:962) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute(AbstractProtocMojo.java:489) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo.execute(AbstractProtocCompileMojo.java:31) at 
     org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360) at 
     org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200) at 
     org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735) at 
     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at 
     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) at 
     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) at 
     org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301) at 
     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at 
     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304) at 
     org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360) at 
     org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383) at 
     org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:487) at 
     org.eclipse.core.internal.resources.Workspace.build(Workspace.java:399) at org.eclipse.ui.actions.GlobalBuildAction
     $1.run(GlobalBuildAction.java:177) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: 
     org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing: ---------- 1) 
     com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 Try downloading the file manually from the project 
     website. Then, install it using the command: mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc 
     -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file Alternatively, if you host 
     your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.google.protobuf -
     DartifactId=protoc -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -
     Durl=[url] -DrepositoryId=[id] Path to dependency: 1) com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT 
     2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 ---------- 1 required artifact is missing. for artifact: 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT from the specified remote repositories: central 
     (https://repo.maven.apache.org/maven2, releases=true, snapshots=false) at 
     org.apache.maven.artifact.resolver.DefaultResolutionErrorHandler.throwErrors(DefaultResolutionErrorHandler.java:71) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact(AbstractProtocMojo.java:960) ... 35 more
    - Missing: ---------- 1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 Try downloading the file 
     manually from the project website. Then, install it using the command: mvn install:install-file -
     DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -
     Dpackaging=exe -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn 
     deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.1.0 -Dclassifier=$
     {os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT 2) com.google.protobuf:protoc:exe:$
     {os.detected.classifier}:3.1.0 ---------- 1 required artifact is missing. for artifact: 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT from the specified remote repositories: central 
     (https://repo.maven.apache.org/maven2, releases=true, snapshots=false) (org.xolstice.maven.plugins:protobuf-maven-
     plugin:0.5.0:compile:default:generate-sources) org.apache.maven.plugin.MojoExecutionException: Missing: ---------- 1) 
     com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 Try downloading the file manually from the project 
     website. Then, install it using the command: mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc 
     -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file Alternatively, if you host 
     your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.google.protobuf -
     DartifactId=protoc -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -
     Durl=[url] -DrepositoryId=[id] Path to dependency: 1) com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT 
     2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 ---------- 1 required artifact is missing. for artifact: 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT from the specified remote repositories: central 
     (https://repo.maven.apache.org/maven2, releases=true, snapshots=false) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact(AbstractProtocMojo.java:962) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute(AbstractProtocMojo.java:489) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo.execute(AbstractProtocCompileMojo.java:31) at 
     org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at 
     org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360) at 
     org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at 
     org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86) at 
     org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200) at 
     org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735) at 
     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at 
     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) at 
     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) at 
     org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301) at 
     org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at 
     org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304) at 
     org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360) at 
     org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383) at 
     org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:487) at 
     org.eclipse.core.internal.resources.Workspace.build(Workspace.java:399) at org.eclipse.ui.actions.GlobalBuildAction
     $1.run(GlobalBuildAction.java:177) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: 
     org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing: ---------- 1) 
     com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 Try downloading the file manually from the project 
     website. Then, install it using the command: mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc 
     -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file Alternatively, if you host 
     your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.google.protobuf -
     DartifactId=protoc -Dversion=3.1.0 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -
     Durl=[url] -DrepositoryId=[id] Path to dependency: 1) com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT 
     2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 ---------- 1 required artifact is missing. for artifact: 
     com.example.grpc:com.example.grpc.maven:jar:0.0.1-SNAPSHOT from the specified remote repositories: central 
     (https://repo.maven.apache.org/maven2, releases=true, snapshots=false) at 
     org.apache.maven.artifact.resolver.DefaultResolutionErrorHandler.throwErrors(DefaultResolutionErrorHandler.java:71) at 
     org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact(AbstractProtocMojo.java:960) ... 35 more
sergei-ivanov commented 7 years ago

Well, at least now we have a publicly available reproducible example of the problematic behaviour. Thank you for that.

I still wish to plead innocence and I kindly ask you to raise a separate ticket in trustin/os-maven-plugin project. Unfortunately, I neither use Eclipse nor have a good enough understanding of what is going on inside it. @trustin may be in a better position there to figure out what is going on.

To me, Missing: ---------- 1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.1.0 indicates that Eclipse was unable to resolve or substitute os.detected.classifier property upon rebuilding the project. An that is the root issue, which causes the protobuf plugin to fail due to misconfiguration.

paulvi commented 7 years ago

Solved in #16 with your link https://github.com/trustin/os-maven-plugin#issues-with-eclipse-m2e-or-other-ides

This issue possibly has to do with the version missmatch in pom.xml and downloaded .jar put into <ECLIPSE_HOME>/plugins directory. So leave open for now.

paulvi commented 7 years ago

Well, while linked solution did worked for simple example https://github.com/paulvi/com.example.grpc.maven

I could not make it work for company project using both 1.4.1.Final or 1.5.0.Final os-mave-plugin

sergei-ivanov commented 7 years ago

It must be some sort of class loading issue in Eclipse that prevents the correct functioning of the os-maven-plugin and its Eclipse extension. I am really sorry, but I won't be able to help you resolve that (and the root cause does not seem to be related to protobuf-maven-plugin at all). Please raise an issue against os-maven-plugin or Eclipse, or both.

iwan-hybrit commented 5 years ago

I fixed this by adding the following sniplet to my maven settings.xml:

<profiles>
    <profile>
        <id>protobuf</id>
        <properties>
            <os.detected.classifier>windows-x86_64</os.detected.classifier>
        </properties>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>protobuf</activeProfile>
</activeProfiles>

Of course the value of the property would need to be changed depending on what OS you're on.