开发者

Generate additional artifact while creating reports or in another phase?

开发者 https://www.devze.com 2023-04-09 19:43 出处:网络
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

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消