kshchepanovskyi / protostuff-googlecode-exported

Automatically exported from code.google.com/p/protostuff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven-Plugin fails for multi-module projects

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. create a maven project with multiple modules
2. add protostuff (config in a properties-file) to one of the modules, so the 
module build works
3. try to build the parent project

What is the expected output? What do you see instead?
build works for the whole project.

What version of the product are you using? On what operating system?
1.0.7

Please provide any additional information below.
the problem seems to be that the java working directory for the parent build is 
the folder with the parent pom. so any new File("relative/path") for the paths 
given in the properties file will fail.

creating the file with the project.build.* or some other maven supplied path 
might do the trick.

Original issue reported on code.google.com by baetz.al...@googlemail.com on 11 Jul 2012 at 1:55

i made some changes to the compiler plugin. now relative paths are evaluated 
based on a base folder. default for this is new File("."). For properties files 
the base folder is the directory the properties file is in.

sorry for the rather lengthy patch. my code formatter was active.

Original comment by baetz.al...@googlemail.com on 18 Jul 2012 at 9:24

Attachments:

It would be easier for me to apply your changes when your patch only includes 
the relevant stuff. (too much formatting garbage)

Original comment by david.yu...@gmail.com on 19 Jul 2012 at 5:01

[deleted comment]
[deleted comment]
new patch

Original comment by baetz.al...@googlemail.com on 20 Jul 2012 at 8:57

Attachments:

Thanks for the patch (sorry for late response).
I added a few minor modifications for flexibility.

So in a submodule, the heirarchy would be something like this.
foo
 foo-baz
   pom.xml
   baz.properties
   src
   target

The contents of baz.properties:
#begin
modules = baz

baz.output = java_bean
baz.outputDir = target/generated-sources
baz.source = src/main/proto
baz.options = separate_schema
#end


With that layout, the config on pom.xml would be as simple as:
      <plugin>
        <groupId>com.dyuproject.protostuff</groupId>
        <artifactId>protostuff-maven-plugin</artifactId>
        <version>${protostuff-version}</version>
        <configuration>
          <modulesFile>baz.properties</modulesFile>
        </configuration>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

If you want to import other modules protos, you might want put the protos in 
src/main/resources so it can be looked up from classpath (add the module as a 
maven dependency)

Added @ rev 1552

Original comment by david.yu...@gmail.com on 29 Aug 2012 at 10:04

  • Changed state: Fixed