protobuf issue

1,750 views
Skip to first unread message

yves.s...@gmail.com

unread,
Jun 27, 2022, 2:19:19 AM6/27/22
to okapi...@googlegroups.com

Since I still have issues with building Okapi from Eclipse, I’ve decided to start by removing the two deprecated connectors as we discussed.

But some new problems have come up.

I can build libs and apps from the command-line, but I’m getting strange errors with missing artifacts.

For example, the build cannot find com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1 (in the okapi-lib-serialization module POM).

 

The POM has:

             <dependency>

                    <groupId>com.google.protobuf</groupId>

                    <artifactId>protobuf-java</artifactId>

             </dependency>

 

What am I missing? Do we have to install something outside the POM-driven process to make protobuf works?

Any pointer welcome…

 

Cheers,

-ys

 

 

 

Yves

unread,
Jun 27, 2022, 3:13:10 AM6/27/22
to okapi-devel
The problem may be the classifier?
It seems the variable ${os.detected.classifier} is not resolved.

The exact error I get is:

Unable to resolve artifact: Missing:
----------
1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
  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.21.1 -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.21.1 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
  Path to dependency:
      1) net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-SNAPSHOT
      2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
----------
1 required artifact is missing.
for artifact:
  net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-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.6.1:compile:default:generate-sources)
org.apache.maven.plugin.MojoExecutionException: Unable to resolve artifact: Missing:
----------
1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
  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.21.1 -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.21.1 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
  Path to dependency:
      1) net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-SNAPSHOT
      2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
----------
1 required artifact is missing.
for artifact:
  net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-SNAPSHOT
from the specified remote repositories:
  central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
    at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute(AbstractProtocMojo.java:589)
    at org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo.execute(AbstractProtocCompileMojo.java:32)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:336)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$8(MavenImpl.java:1423)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:117)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1422)
    at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:55)
    at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:135)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:169)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$1(MavenBuilder.java:114)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:117)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:105)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:156)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:103)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:88)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:198)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:860)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:392)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:417)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.xolstice.maven.plugin.protobuf.MojoInitializationException: Unable to resolve artifact: Missing:
----------
1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
  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.21.1 -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.21.1 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
  Path to dependency:
      1) net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-SNAPSHOT
      2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
----------
1 required artifact is missing.
for artifact:
  net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-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:1071)
    at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute(AbstractProtocMojo.java:529)
    ... 32 more
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
  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.21.1 -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.21.1 -Dclassifier=${os.detected.classifier} -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
  Path to dependency:
      1) net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-SNAPSHOT
      2) com.google.protobuf:protoc:exe:${os.detected.classifier}:3.21.1
---------
1 required artifact is missing.
for artifact:
  net.sf.okapi.lib:okapi-lib-serialization:jar:1.44.0-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:73)
    at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact(AbstractProtocMojo.java:1069)
    ... 33 more

Yves

unread,
Jun 27, 2022, 3:40:34 AM6/27/22
to okapi-devel
It looks like the problem can be solved by using os-maven-plugin as a plugin instead of an extension as it is currently declared.
So we have both ways now. But I'm not sure we should keep both. Can it work as a plugin with IntelliJ too? If so maybe we should keep only one way?

I will open a PR with the changes (and the connectors removal) soon.

-ys
Reply all
Reply to author
Forward
0 new messages