0

I understand that you can create only one artifact from one pom in maven.

I wrote a javadoc doclet that creates an html report of my artifact (my-rest-api). This doclet can also create stub requests and models for writing integration tests. My problem is now, that I have to manually copy the generated classes into a third maven project (my-test-models) in order to create an artifact from it. Is there any other way? The generated classes are created from source so I cannot just depend on the my-rest-api artifact. I could hard-code paths between both project but I don't like that neither. Any ideas?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Jan
  • 2,803
  • 6
  • 36
  • 57

1 Answers1

0

From what I understand of your question, you can install/deploy the source of my-rest-api artifact and in your my-test-models, specify this as a dependency.

You can use maven source plugin to do this.

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.1.2</version>
            <executions>
                <execution>
                  <id>attach-sources</id>
                  <goals>
                    <goal>jar</goal>
                  </goals>
                </execution>
             </executions>
        </plugin>
Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • the request model sources are generated in the "report" phase. Isn't that after the 'jar' goal? – Jan Oct 07 '11 at 10:14
  • another issue that I cannot depend on that "source" artifact (i guess) without getting all dependencies of the binary artifact (which would be the whole server) – Jan Oct 11 '11 at 08:33