Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 152 by rktoomey: Maven Protoc Plugin fails when a jar file contains a .proto file (FileNotFoundException)
http://code.google.com/p/protobuf/issues/detail?id=152

What steps will reproduce the problem?
This repro is the same as in Issue 138
(http://code.google.com/p/protobuf/issues/detail?id=138)
1. Build project (A) so the that .proto file is embedded in the jar file.
2. Create project (B) that also has a .proto file.
3. Add (A) as a dependency of (B)
4. In project (B) Try to:   mvn -X clean install

What is the expected output? What do you see instead?

I expect a successful build instead I get:

[INFO] [protoc:compile {execution: generate-sources}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An IO error occured

Embedded error:
c:\projectB\target\protobuf-temp\C:\m2\repository\projectA\1.2.0-SNAPSHOT\projectA-1.2.0-SNAPSHOT.jar\projectA_messages.proto
(The filename, directory name, or volume label syntax is incorrect)
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An IO error occured
        at
<SNIP>

Caused by: org.apache.maven.plugin.MojoExecutionException: An IO error occured
        at
com.google.protobuf.maven.AbstractProtocMojo.execute(AbstractProtocMojo.java:125)
        at
com.google.protobuf.maven.ProtocCompileMojo.execute(ProtocCompileMojo.java:22)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by: java.io.FileNotFoundException:
c:\projectB\target\protobuf-temp\C:\m2\repository\projectA\1.2.0-SNAPSHOT\projectA-1.2.0-SNAPSHOT.jar\projectA_messages.proto
(The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at
org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1058)
        at
com.google.protobuf.maven.AbstractProtocMojo.makeProtopathFromJars(AbstractProtocMojo.java:211)
        at
com.google.protobuf.maven.AbstractProtocMojo.execute(AbstractProtocMojo.java:104)
        ... 20 more

What version of the product are you using? On what operating system?
maven-protoc-plugin 0.1.2
maven 2.2.1
java 1.6.0_17
OS is Windows 7, typically I use Cygwin.

Please provide any additional information below.

Project A is a jar file in my local Maven repository which contains
projectA_messages.proto.

Project B depends on the jar file for Project A.

It looks like maven-protoc-plugin finds the jar file in the dependencies
and falls down trying to extract the .proto file.

Possibly related to http://code.google.com/p/protobuf/issues/detail?id=138?

--
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
-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.


Reply via email to