maven 打包上传source.jar javadoc.jar到私有服务器

阅读数:113 评论数:0

跳转到新版页面

分类

应用软件

正文

<plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</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.10.4</version>
                <configuration>
                    <encoding>utf-8</encoding>
                    <aggregate>true</aggregate>
                    <charset>utf-8</charset>
                    <docencoding>utf-8</docencoding>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

一、maven-source-plugin

在很多情况下,需要对于maven工程源代码进行源文件的打包,可以利用source插件来完成。

execution下可配置phase属性,意思是在什么阶段打包源文件,如<phase>install</phase>,表示在执行mvn install 时打包源代码。

执行mvn deploy,maven会自动将source deploy到remote-repository,执行mvn source:jar 单独打包源码。

1、verify阶段

运行任何检查,验证包是否有效且达到质量标准。

2、goals

这个插件有五个goal

(1)aggregate

集成所有模块的源码到一个集成的项目里。

(2)jar

bundle the main sources of the project into a jar archive

(3)test-jar

bundle the test sources of the project into a jar archive

(4)jar-no-fork

和jar类似,但不fork the build lifecycle

(5)test-jar-no-fork

类似于test-jar,但不fork the build lifecycle

二、maven-javadoc-plugin

1、关闭doclint

 

 




相关推荐

Nexus是maven仓库管理器,可以使用它在本地架构一个maven仓库服务器。 http://www.sonatype.org/nexus/

目的 在你的maven项目中创建一个Docker镜像。比方说,build过程可以为java服务输出一个可以运行该服务的Docker镜像。 步骤 有两种配置方式,一种是通过Dockerfile文件,一种

&lt;mirror&gt; &lt;id&gt;alimaven&lt;/id&gt; &lt;name&gt;

Maven中的dependencyManagement元素提供了一种管理依赖版本号的方式。在dependencyManagement元素中声明所依赖的jar包的版本号等信息,那么所有<stron

在pom.xml中使用distributionManagement将项目打包上传到nexus私服(maven的一种远程私有仓库)。 <pre class="language-markup

一、概述 repositories配置jar仓库,pluginRepositories配置插件仓库。 二、通过项目pom.xml配置 <repositories> <repository>

dependencyManagement 只是声明依赖,并不实际引入,只有在子项目中写了该依赖项,并且没有指定具体版本,才会从父项目继承该项。 denpende

一、前置知识 1、settings.xml中的proxy、server、repository、mirror proxy 是服务器不能直接访问外网时需要设置的代理服务。 server 是服务器

在Maven的pom.xml文件中,存在如下两种build &lt;project&gt; &lt;buil

在构建Maven项目的时候,如果没有进行特殊配置,Maven会按照 标准的目录结构查找和处理各种类型文件。 src/main/java和src/test/java <p