Skip to content

plugin does not handle namespaces: imports are not recognized #140

@kanehekili

Description

@kanehekili

My protos need to have a namespace, hence they have a "base" folder under protobuf, which they have to reference (using it for python). But qualified paths are not accepted.

Working Example
import "another.proto"

Failing:
import /myNamespace/another.proto

protoc is able to compile that code. Is this plugin capable of namespaces or is just my config wrong? (just the base parts)

            <plugin>
                <groupId>com.github.os72</groupId>
                <artifactId>protoc-jar-maven-plugin</artifactId>
                <version>3.11.4</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <inputDirectories>
                                <include>${basedir}/protobuf</include>
                            </inputDirectories>
                            <outputTargets>
			          <outputTarget>
				          <type>java</type>
				          <addSources>main</addSources>
			          </outputTarget>
		          </outputTargets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

directory structure:

protobuf
    myNamespace
        a.proto
        b.proto
        folderA
           c.proto
           d.proto
        ...   

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