• maven上传源码脚本


    mvn deploy:deploy-file -Dmaven.test.skip=true -Dfile=./target/bbc-common-1.0.0-source.jar 
      -DgroupId=com.xsxy.bbc -DartifactId=1.0.0 -Dpackaging=jar -Dclassifier=sources -DrepositoryId=release -Durl=http://git.private-release

    maven-source-plugin提供项目自动将源码打包并发布的功能,在需要发布源码项目的pom.xml文件中添加如下代码即可:

    <!-- Source attach plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

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

    注意:在多项目构建中,将source-plugin置于顶层或parent的pom中并不会发挥作用,必须置于具体项目的pom中。

    pom中依赖本地的jar

    <dependency>
                <groupId>com.example</groupId>
                <artifactId>demo</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <scope>system</scope>
                <systemPath>${project.basedir}/src/main/resources/lib/demo.jar</systemPath>
    </dependency>
  • 相关阅读:
    C语言I博客作业04
    C语言II博客作业04
    C语言II作业03
    C语言II博客作业02
    C语言II博客作业01
    第一周C语言作业
    C语言I博客作业02
    C语言I博客作业08
    C语言I博客作业07
    C语言I博客作业06
  • 原文地址:https://www.cnblogs.com/nxzblogs/p/11504588.html
Copyright © 2020-2023  润新知