Re: Issue 81 in protobuf: Maven Protoc Plugin Code Review

250 views
Skip to first unread message

prot...@googlecode.com

unread,
Feb 14, 2010, 11:11:55 AM2/14/10
to prot...@googlegroups.com

Comment #15 on issue 81 by supercargo: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

I have found a bug in the way that the derivedProtopathElements get
calculated. It
is assumed that all the dependency artifacts will be files (specifically
jar files)
but this is not the case when doing a reactor (multi-module) build.

For reactor builds, the compile artifacts can be directories, e.g.,
target/classes,
from other modules that were built as part of the same mvn invocation.

I'd like to second the comment that I don't really see the need to always
be looking
in dependency jars for .proto files. If I'm depending on an artifact with
proto
files, why would I assume that the java bindings were not generated and
included in
that dependency's jar? My preference would be to require transitive
sources of proto
files be listed explicitly in the plugin config.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

prot...@googlecode.com

unread,
Feb 15, 2010, 7:14:35 AM2/15/10
to prot...@googlegroups.com

Comment #16 on issue 81 by brice.figureau: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

@supercargo,

I fixed this bug in the github fork:
http://github.com/dtrott/maven-protoc-plugin

There is also a maven repository holding a version that contains that fix.

prot...@googlecode.com

unread,
May 11, 2010, 5:14:08 PM5/11/10
to prot...@googlegroups.com

Comment #17 on issue 81 by walker.zach: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

I think my comment is similar to the issues raised by comments 5 and 15.

I attempted to use the plugin to generate code from a .proto file that
imported
messages from an external .proto file. First, I attempted to add a jar file
containing both the depended on .proto and the java classes generated from
it to the
dependency list in my pom file. I would then get the error message.

org.apache.maven.BuildFailureException: Protoc failed to execute because:
null
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:699)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoFailureException: Protoc failed to
execute
because: null
at
com.google.protobuf.maven.AbstractProtocMojo.execute(AbstractProtocMojo.java:127)
at
com.google.protobuf.maven.ProtocCompileMojo.execute(ProtocCompileMojo.java:22)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
... 16 more
Caused by: java.lang.IllegalArgumentException
at
com.google.common.base.Preconditions.checkArgument(Preconditions.java:70)
at
com.google.protobuf.maven.Protoc$Builder.addProtopathElement(Protoc.java:178)
at
com.google.protobuf.maven.Protoc$Builder.addProtopathElements(Protoc.java:188)
at
com.google.protobuf.maven.AbstractProtocMojo.execute(AbstractProtocMojo.java:109)
... 19 more


I'm not sure exactly what the problem was but I could tell that it was
related to the
plugin attempting to resolve the compile dependency on the jar with
the .proto and
generated classes. I took a look at the source and found that the plugin's
comile
goal is linked to the compile time dependencies in the pom file. I
couldn't figure
out why the protoc compiler would need any dependency resources, so I
removed the
@requiresDependencyResolution annotation from ProtocCompileMojo.java and
rebuilt the
plugin. The error then went away.

It would be nice if a the .proto file compiled by the plugin could import
another
.proto file from a jar in the pom dependencies.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

prot...@googlecode.com

unread,
Jul 14, 2010, 11:31:07 AM7/14/10
to prot...@googlegroups.com

Comment #18 on issue 81 by akbertram: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

Can we merge into the trunk in time for release 2.3.1 ?

Here is a patch that merges this the maven-plugin branch into r344 and
fixes issues #138 and #149 and #152

Please?

prot...@googlecode.com

unread,
Jul 20, 2010, 8:02:14 PM7/20/10
to prot...@googlegroups.com

Comment #19 on issue 81 by ken...@google.com: Maven Protoc Plugin Code
Review
http://code.google.com/p/protobuf/issues/detail?id=81

Hi all,

It seems clear that Greg doesn't have time to maintain this, and I can't
maintain it either as I know nothing about Maven. Would someone like to
fork it off into a separate googlecode project? It seems logically
separate anyway. (In fact, I'm planning to split the protobuf C++, Java,
and Python components into three separate projects at some point.)

prot...@googlecode.com

unread,
Jan 26, 2011, 2:57:03 PM1/26/11
to prot...@googlegroups.com
Updates:
Owner: g...@google.com

Comment #20 on issue 81 by g...@google.com: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

Kenton brought this issue to my attention offline and I apologize for
ignoring it. This issue has been assigned to an account I haven't be using.

It looks like there are a lot of good bug reports and some good patches. I
believe that, in order to integrate the patches, the authors need to agree
to the CLA (http://code.google.com/legal/individual-cla-v1.0.html), which
can be sort of a hassle.

Though there seems to be interest here, I'm tempted to just deprecate it in
favor of http://github.com/dtrott/maven-protoc-plugin as it seems that is
being very actively developed. Any compelling reasons not to?

prot...@googlecode.com

unread,
Jan 26, 2011, 3:01:08 PM1/26/11
to prot...@googlegroups.com
Issue 81: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

This issue is now blocking issue 138.
See http://code.google.com/p/protobuf/issues/detail?id=138

--

prot...@googlecode.com

unread,
Jan 26, 2011, 3:09:19 PM1/26/11
to prot...@googlegroups.com
Issue 81: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

This issue is now blocking issue 149.
See http://code.google.com/p/protobuf/issues/detail?id=149

prot...@googlecode.com

unread,
Jan 26, 2011, 3:21:03 PM1/26/11
to prot...@googlegroups.com
Issue 81: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

This issue is now blocking issue 152.
See http://code.google.com/p/protobuf/issues/detail?id=152

prot...@googlecode.com

unread,
Jan 26, 2011, 9:08:51 PM1/26/11
to prot...@googlegroups.com

Comment #21 on issue 81 by jaso...@gmail.com: Maven Protoc Plugin Code
Review
http://code.google.com/p/protobuf/issues/detail?id=81

I don't suppose the protoc compiler itself could be distributed as a maven
artifact? It would be great to be able to specify it in the pom instead of
having to ensure an exe exists in the path of every machine that builds the
source.

prot...@googlecode.com

unread,
Jan 27, 2011, 2:38:54 PM1/27/11
to prot...@googlegroups.com

Comment #22 on issue 81 by g...@google.com: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

I don't believe that Maven has any support for platform-dependent
artifacts. That said, it might be worth documenting installation via some
of the different package management utilities (e.g. apt, macports).

prot...@googlecode.com

unread,
Mar 19, 2011, 6:48:45 PM3/19/11
to prot...@googlegroups.com

Comment #23 on issue 81 by facto...@gmail.com: Maven Protoc Plugin Code
Review
http://code.google.com/p/protobuf/issues/detail?id=81

Would classifiers (e.g. <classifier>windows</classifier>) help in the
creation of platform-dependent artifacts?

prot...@googlecode.com

unread,
Sep 25, 2012, 9:53:31 AM9/25/12
to prot...@googlegroups.com

Comment #24 on issue 81 by nickm...@gmail.com: Maven Protoc Plugin Code
Review
http://code.google.com/p/protobuf/issues/detail?id=81

I noticed the other day that there is a warning in the protoc maven plugin
code generated by the latest Eclipse Juno that suggested there was a
resource leak. (I don't have the setup any more and my memory of the exact
error was a little fuzzy, but I recall when I looked at the code that there
was a stream that needed to be closed and was not.)

prot...@googlecode.com

unread,
Sep 25, 2012, 12:27:18 PM9/25/12
to prot...@googlegroups.com

Comment #25 on issue 81 by g...@google.com: Maven Protoc Plugin Code Review
http://code.google.com/p/protobuf/issues/detail?id=81

Take a look at comment #20. It seems that others have developed a plugin
that was less experimental and better-supported. You're probably better
off switching over to that.

prot...@googlecode.com

unread,
Oct 6, 2014, 2:44:47 PM10/6/14
to prot...@googlegroups.com
Updates:
Status: WontFix

Comment #26 on issue 81 by xiaof...@google.com: Maven Protoc Plugin Code
Review
https://code.google.com/p/protobuf/issues/detail?id=81

(No comment was entered for this change.)

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

prot...@googlecode.com

unread,
Oct 6, 2014, 2:57:34 PM10/6/14
to prot...@googlegroups.com
Issue 81: Maven Protoc Plugin Code Review
https://code.google.com/p/protobuf/issues/detail?id=81

This issue is now blocking issue protobuf:138.
See https://code.google.com/p/protobuf/issues/detail?id=138

--

prot...@googlecode.com

unread,
Oct 6, 2014, 2:58:33 PM10/6/14
to prot...@googlegroups.com

prot...@googlecode.com

unread,
Oct 6, 2014, 3:00:32 PM10/6/14
to prot...@googlegroups.com
Issue 81: Maven Protoc Plugin Code Review
https://code.google.com/p/protobuf/issues/detail?id=81

This issue is now blocking issue protobuf:149.
See https://code.google.com/p/protobuf/issues/detail?id=149

prot...@googlecode.com

unread,
Oct 6, 2014, 3:01:32 PM10/6/14
to prot...@googlegroups.com

prot...@googlecode.com

unread,
Oct 6, 2014, 3:04:32 PM10/6/14
to prot...@googlegroups.com
Issue 81: Maven Protoc Plugin Code Review
https://code.google.com/p/protobuf/issues/detail?id=81

This issue is now blocking issue protobuf:152.
See https://code.google.com/p/protobuf/issues/detail?id=152

prot...@googlecode.com

unread,
Oct 6, 2014, 3:05:32 PM10/6/14
to prot...@googlegroups.com

prot...@googlecode.com

unread,
Oct 6, 2014, 4:34:11 PM10/6/14
to prot...@googlegroups.com
Issue 81: Maven Protoc Plugin Code Review
https://code.google.com/p/protobuf/issues/detail?id=81

This issue is now blocking issue protobuf:250.
See https://code.google.com/p/protobuf/issues/detail?id=250

prot...@googlecode.com

unread,
Oct 6, 2014, 4:35:12 PM10/6/14
to prot...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages