Protostuff - Incorrect output path is generated in Windows for .java files

170 Views Asked by At

I am getting error "The filename, directory name, or volume label syntax is incorrect" due to the protostuff-maven-plugin not generating proper output path while it's working fine on Mac. Following are the details:

Errors caused by: java.io.FileNotFoundException: C:\ABC\target\generated-sources\com\abc\optimization\common\vdf\C:\ABC\src\main\protostuff\VDFCollectionTypeSchema.java (The filename, directory name, or volume label syntax is incorrect)

Just the file name should be appended to the path but it appends another absolute path. Here is the config section [Refer to the attached image for complete configuration]:

<source>src/main/protostuff/VDFDataProto.proto</source>
<outputDir>target/generated-sources</outputDir>
<output>src/main/protostuff/$Schema.java.stg</output>
<encoding>UTF-8</encoding>

The output path should be: C:\ABC\target\generated-sources\com\abc\optimization\common\vdf\VDFCollectionTypeSchema.java

instead it generates C:\ABC\target\generated-sources\com\abc\optimization\common\vdf\C:\ABC\src\main\protostuff\VDFCollectionTypeSchema.java

I am using protostuff version 1.3.0, 1.2.0 as well has this issue.

1

There are 1 best solutions below

0
On

It seems to be a defect in the library.

For now we resolved the issue by specifying absolute path for windows. So now we have different configurations for Windows and Mac (Not an elegant solution, but until we have the library fixed we can live with this).

<source>C:/GIT/ABC/common/src/main/protostuff/DataProto.proto</source>
<outputDir>C:/GIT/ABC/common/target/generated-sources</outputDir>
<output>C:/GIT/ABC/common/src/main/protostuff/$Schema.java.stg</output>
<encoding>UTF-8</encoding>

I have created a defect at- https://code.google.com/p/protostuff/issues/detail?id=166