• maven 打包以及上传


    插件

    --------------------------------------------------------------------------------------------------------------------

    <plugins>
    <!-- compiler插件, 设定JDK版本 -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
    <source>${java.version}</source>
    <target>${java.version}</target>
    <showWarnings>true</showWarnings>
    </configuration>
    </plugin>
    <!-- resources插件 -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    </plugin>
    <!-- install插件 -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    </plugin>

    <!-- 打包源码 -->
    <plugin>
    <artifactId>maven-source-plugin</artifactId>
    <version>2.1</version>
    <configuration>
    <attach>true</attach>
    </configuration>
    <executions>
    <execution>
    <phase>compile</phase>
    <goals>
    <goal>jar</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    <!-- 生成java doc注释 -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.10.2</version>
    <configuration>
    <aggregate>true</aggregate>
    </configuration>
    <executions>
    <execution>
    <id>attach-javadocs</id>
    <goals>
    <goal>jar</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>

    maven setting 配置 snapshots

    --------------------------------------------------------------------------------------------------------------------

    <profiles> 

    <profile>
    <id>public-snapshots</id>
    <repositories>
    <repository>
    <id>public-snapshots</id>
    <url>http://public-snapshots</url>
    <releases>
    <enabled>false</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </repository>
    </repositories>
    <pluginRepositories>
    <pluginRepository>
    <id>public-snapshots</id>
    <url>http://public-snapshots</url>
    <releases>
    <enabled>false</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </pluginRepository>
    </pluginRepositories>
    </profile>
    <profile>
    <id>downloadSources</id>
    <properties>
    <downloadSources>true</downloadSources>
    <downloadJavadocs>true</downloadJavadocs>
    </properties>
    </profile>
    </profiles>

    <activeProfiles>
    <activeProfile>public-snapshots</activeProfile>
    <activeProfile>downloadSources</activeProfile>
    </activeProfiles>

    maven 命令

    --------------------------------------------------------------------------------------------------------------------

    上传javadoc: mvn clean javadoc:jar deploy   (http://maven.apache.org/plugins/maven-javadoc-plugin/faq.html#How_to_deploy_Javadoc_jar_file)

    打包命令:mvn clean package

    上传命令:mvn deploy

    打包命令:mvn install 

    生成javadoc文档命令: mvn javadoc:jar

     强制更新:mvn clean install -e -U

    -e详细异常,-U强制更新

  • 相关阅读:
    CentOS7下安装Scrapy
    阿里云ECS提示RHSA-2017:3263: curl security update
    CentOS 7.0安装配置LAMP服务器(Apache+PHP+MariaDB)
    Electron: 从零开始写一个记事本app
    flask请求流程
    编写Dockerfile
    docker-compose使用
    redis持久化切换rdb到aof
    RESTful API规范
    介绍importlib
  • 原文地址:https://www.cnblogs.com/adolfmc/p/5067766.html
Copyright © 2020-2023  润新知