开发者

Trouble with Hudson deploying artifacts other than project .war

I've got a project setup with Maven, being built in Hudson and artifacts deployed to Archiva. This all works as expected (final artifact is a .jar file).

The trouble I'm having is I'm trying to include Javadocs and source-code of the project in addition to the .jar.

I'm using the maven source/javadoc plugins, and both generate the desired javadoc/sources jar files in my local target directory.

When building in Hudson these additional jar files also appear in the "Last 开发者_运维问答Successful Artifacts" area, but only the project .jar is deployed to Archiva.

I've tried using the build-helper-maven-plugin to specify one of the .jar files as an additional source, but still only the main .jar is deployed to Archiva.

In Hudson my "Files to Archive" is set to: */.j*

Any help/suggestions would be greatly appreciated!


This is probably the configuration you need:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-source-plugin</artifactId>
    <version>2.1.2</version>
    <executions>
        <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
                <goal>jar-no-fork</goal>
            </goals>
        </execution>
    </executions>
</plugin>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.7</version>
    <executions>
        <execution>
            <id>attach-javadocs</id>
            <goals>
                <goal>jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Now if you do either mvn install or mvn deploy, both the source jar and the javadoc jar will be created and attached to the build.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜