Git Product home page Git Product logo

maven-protoc-plugin's People

Contributors

abatalev avatar atorstling avatar devans avatar dtrott avatar kedzie avatar rwicke avatar sergei-ivanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maven-protoc-plugin's Issues

Add support for custom native plugins

Required parameters:

  • plugin_id: this can be automatically resolved by protoc to executable name (must be in the PATH)

Optional:

  • plugin_executable: an explicit path to the executable
  • output_directory: to be derived by default from Maven project environment and plugin_id
  • parameter: optional parameter to be passed to the plugin

All other parameters inherited from base mojos.
In order to avoid clashes with built-in plugins, need to check that plugin_id is not one of cpp, java, python or descriptor_set.

Nice to have: support for toolchains. That will require two additional parameters: toolchain_type and toolchain_tool.

Configure .proto files path

By default it's src/main/proto and it's ok for java. But for Android it should be changed (yes, now android studio supports /src/main/java-like paths but most current android project still use /src for java classes and /proto for .proto).

Can you add protoPath value to configuration section?

Clean up javadocs in order to appease doclint in java 8

Java 8 introduced stringent checks for javadoc well-formedness, which are turned on by default. Need to make sure that all plugin javadocs are up to standard and that site generation under java 8 completes successfully.

Add an option to attach descriptor set to the build

At the moment it appears that the generated descriptor set is not attached to the build and there is no configuration option to do so. Need to add an attachDescriptorSet flag and an optional descriptorSetClassifier.

Proto file source in android APK file

After as proto is compiled I found source proto file in generated classes folder, it lead that proto source code available in APK build file (I write for android). It is very insecure, I don't want to share my protocol to public. How I cant prevent it?

Version conflict for plexus-utils in Eclipse build

At the demand of a few engineers in my org, I'm trying to integrate the Maven+proto tooling into a working Eclipse build. I've had success getting successful builds at the command line but am struggling to make sense of this issue. It appears there is a version conflict between the various version of plexus-utils on which a lot of plugins rely — maven-protoc-plugin has made the leap to 3.0.10 while the rest of the world uses 2.0.5 or even 1.5.*. The following error output annotates the pom.xml file in Eclipse:

Execution Generate proto sources of goal com.google.protobuf.tools:maven-protoc-plugin:0.3.1:compile failed: An API incompatibility was encountered while executing com.google.protobuf.tools:maven-protoc-plugin:0.3.1:compile: java.lang.NoSuchMethodError: org.codehaus.plexus.util.DirectoryScanner.setupMatchPatterns()V
-----------------------------------------------------
realm =    plugin>com.google.protobuf.tools:maven-protoc-plugin:0.3.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/jsilland/.m2/repository/com/google/protobuf/tools/maven-protoc-plugin/0.3.1/maven-protoc-plugin-0.3.1.jar
urls[1] = file:/Users/jsilland/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
urls[2] = file:/Users/jsilland/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar
urls[3] = file:/Users/jsilland/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.jar
urls[4] = file:/Users/jsilland/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[5] = file:/Users/jsilland/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
urls[6] = file:/Users/jsilland/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
urls[7] = file:/Users/jsilland/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[8] = file:/Users/jsilland/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
urls[9] = file:/Users/jsilland/.m2/repository/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar
urls[10] = file:/Users/jsilland/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
urls[11] = file:/Users/jsilland/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
urls[12] = file:/Users/jsilland/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
urls[13] = file:/Users/jsilland/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
urls[14] = file:/Users/jsilland/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
urls[15] = file:/Users/jsilland/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
urls[16] = file:/Users/jsilland/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[17] = file:/Users/jsilland/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[18] = file:/Users/jsilland/.m2/repository/org/sonatype/aether/aether-util/1.13.1/aether-util-1.13.1.jar
Number of foreign imports: 4
import: Entry[import org.sonatype.plexus.build.incremental from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.Scanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.AbstractScanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------
 (com.google.protobuf.tools:maven-protoc-plugin:0.3.1:compile:Generate proto sources:generate-sources)

And indeed, that particular method (protected setupMatchPatterns) is new in plexus v3. I've reached a functional state by forcing down the version of plexus-utils in the maven-protoc-plugin deps. I guess there might be some different way of solving this issue but my investigation has failed to find another way:

            <plugin>
                <groupId>com.google.protobuf.tools</groupId>
                <artifactId>maven-protoc-plugin</artifactId>
                <version>0.3.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-utils</artifactId>
                        <version>2.0.5</version>
                    </dependency>
                </dependencies>
            </plugin>

Is there another way besides sprinkling this all over my projects?

Drop support for Maven2 and make Maven 3.0.0 the minimum required version

Maven2 is officially end of life and not supported anymore. In line with changes in Apache and CodeHaus Maven plugins, the minimum required Maven version for the plugin will be 3.0.0. This will allow to remove extraneous dependencies and any code that exists solely for compatibility reasons with Maven2.

Command line too long

Hi,
We have a large number of proto files to be compiled. We're getting an error about the command line being too long. Is it possible for the plugin to invoke protoc for one file at a time?

Download protobuf distribution instead of using the one available

In a multi-developer & multi-platform environment, one should take in mind that protoc location is a mutable value.

Since this plug-in allows you to define protoc path in the POM, this is somewhat covered. But would be great if the plug-in could simply download the protoc distribution (depending on the version specified in the POM) and make it available to the user in ~/.protobuf_dist. It would only take the time to download the first time but would then be available to every developer, no matter what OS he'd be running.

Make clearing out of the output directory optional

At the moment, the plugin clears out the output directory before invoking protoc. This is often more of an annoyance than help, and it should be made optional. protoc always overwrites the output files and does not complain if they already exist. Maven clean lifecycle goal can be used to clear out the output directory if required.

No license specified

It is better to explicitly to specify the license of any project. Github does not have a sort of default license. Just by publishing your project to github you accept some terms that allow to view and fork the project, but it is still uncertain.

allow compiling dependent files

I have class a.proto that imports b.proto.

When I use maven-protoc-plugin it compiles both files with a single protoc command and then
protoc fails with
" PROTOC FAILED: b.proto:21:20: "Msg" is already defined in file "b.proto".

That happens because protoc imports b.proto twice: first when importing a.proto and then when importing b.proto.

URL specified in pluginRepository goes to 404 location

The URL listed in the README no longer works:

<pluginRepositories>
    <pluginRepository>
        <id>protoc-plugin</id>
        <url>http://sergei-ivanov.github.com/maven-protoc-plugin/repo/releases/</url>
    </pluginRepository>
</pluginRepositories>

Maven 3.2.5 breaks the toolchain support in the plugin

Changes in https://jira.codehaus.org/browse/MNG-5718 broke backward API compatibility for toolchain providers. As a result, the plugin cannot be used with Maven 3.2.5 or later. Need to integrate a workaround from Hervé's reference implementation:
http://svn.apache.org/viewvc/maven/plugins/tags/maven-toolchains-plugin-1.1/src/it/custom-toolchain-plugin/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java?view=markup

Preserve dependency ordering for protobuf imports

Submitted by David Elliott

I only have one issue with it: it doesn’t keep the proto_path option in dependency order and this causes problems when people are shadowing .proto files.

It’s a one-line fix: use a new LinkedHashSet just like Maven itself uses to keep the Artifact sets ordered.

Any in src/test/proto cause all protos defined in /src/main/proto to be generated in generated-test-sources

To replicate this issue, create a project with a .proto file in it:

src/main/proto/foo.proto

Run mvn compile and the generated java files go in targets/generated-sources. So far so good.

Now, rm -rf the target directory and put any file into the src/test/proto directory:

rm -rf target
touch src/test/proto/README.md

Re-run mvn compile. The proto files are now all generated into targets/generated-test-sources and invisible outside of scope "test" to other projects.

The issue is that there is only one java output directory and if you set it twice using Protoc.setJavaOutputDirectory(), the last one wins. We could patch around this issue by skipping the setJavaOutputDirectory() in if there are no valid .proto source files inside of ProtocTestCompileMojo.addProtocBuilderParameters(). That will fix this case, but might allow you to define protos both in src/main/proto and src/test/proto in the same project.

Upload maven-protoc-plugin to Maven Central

I'm about to publish a library whose Maven artifact uses this plugin to compile proto messages. I'd like to make this library available on Maven Central, which discourages the use of pluginRepositories and provides only a convoluted way for me to upload a third party artifact to Central, which I would like to avoid doing myself: https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+The+Central+Repository

Is there a concrete plan to make maven-protoc-plugin available on central? I read in a separate bug that there's talk of doing a clean-room implementation of this plugin due to some confusion surrounding licenses, but would this further delay to publishing of this plugin to the rest of the world. I'm happy to contribute time and code to this effort if the plans for this have already been devised.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.