Import "someObj.proto" was not found or had errors

Viewed 1177

I need to import a .proto file defined in a jar in our central maven.

Here's my build.gralde:

apply plugin: 'com.google.protobuf'
buildscript {
    repositories {
        maven {
            url 'http://abc.def.com/content/groups/public/'
        }
        maven {
            url 'http://abc.def.com/content/repositories/snapshot/'
        }
    }

    dependencies {
        classpath 'def.abc.someObj:someObj-proto:1.2'
    }
}

protobuf {
    generatedFilesBaseDir="$projectDir/src/"
}

sourceSets {
    main {
        // this tells the plugin where your project specific
        // protofiles are located
        proto {
            srcDir 'src/main/resources/proto/'
        }

        java {
            srcDir 'src/main/java'
        }
    }
}

Here's my other.proto file:

syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.def.abc";

import "google/protobuf/any.proto";
import "someObj.proto";

whenever I try to compile, it's always complaining at

Import "someObj.proto" was not found or had errors.

I've downloaded the jar file from this maven, and clearly saw that this someObj.proto is in there.

Any ideas please?

Thanks!

0 Answers
Related