I understand that you ca开发者_开发百科n 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?
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>
精彩评论