Skip to content

Maven build works only within Intellij #192

@kgonia

Description

@kgonia

Hi, I've encountered a strange problem while trying to build a project from the console. Strangely enough, it works fine in IntelliJ.

Command

mvn package -Dmaven.test.skip=true -f pom.xml

Result

[INFO] --- build-helper:3.2.0:add-source (add-source) @ jlama-net ---
[INFO] Source directory: /home/ubuntu/IdeaProjects/Jlama/jlama-net/target/generated-sources/openapi/java/main added.
[INFO]
[INFO] --- protobuf:4.1.1:generate (default) @ jlama-net ---
[WARNING] Error injecting: io.github.ascopes.protobufmavenplugin.mojo.MainGenerateMojo
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/NullInjectedIntoNonNullable]: null returned by binding at LocatorWiring
 but the 2nd parameter artifactPathResolver of ProtocResolver.<init>(ProtocResolver.java:71) is not @Nullable
  at LocatorWiring
  at ProtocResolver.<init>(ProtocResolver.java:71)
      \_ for 2nd parameter artifactPathResolver
  at LocatorWiring
  while locating ProtocResolver annotated with interface TypeArguments$Implicit
  at LocatorWiring
  at ProtobufBuildOrchestrator.<init>(ProtobufBuildOrchestrator.java:85)
      \_ for 2nd parameter protocResolver
  at LocatorWiring
  while locating ProtobufBuildOrchestrator annotated with interface TypeArguments$Implicit
  at LocatorWiring
  at AbstractGenerateMojo.sourceCodeGenerator(AbstractGenerateMojo.java:70)
      \_ for field sourceCodeGenerator
  while locating MainGenerateMojo

Learn more:
  https://github.com/google/guice/wiki/NULL_INJECTED_INTO_NON_NULLABLE

1 error

======================
Full classname legend:
======================
AbstractGenerateMojo:      "io.github.ascopes.protobufmavenplugin.mojo.AbstractGenerateMojo"
LocatorWiring:             "org.eclipse.sisu.wire.LocatorWiring"
MainGenerateMojo:          "io.github.ascopes.protobufmavenplugin.mojo.MainGenerateMojo"
ProtobufBuildOrchestrator: "io.github.ascopes.protobufmavenplugin.generation.ProtobufBuildOrchestrator"
ProtocResolver:            "io.github.ascopes.protobufmavenplugin.protoc.ProtocResolver"
TypeArguments$Implicit:    "org.eclipse.sisu.inject.TypeArguments$Implicit"
========================
End of classname legend:
========================

Any ideas what might be the reason?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions