maven打包scope为system的jar包依赖

springboot 和 war的相关处理网上有很多,这里就不再赘述了。本文只介绍单纯的简单maven项目如何打包scope为system的jar包依赖。
以tools.jar举例:

<dependency>
     <groupId>com.sun</groupId>
     <artifactId>tools</artifactId>
     <version>1.8</version>
 </dependency>
<build>
        <plugins>
            <!-- 这里要加入其它的plugin,比如打包的,编译的等 -->
			<!-- 下面是关键所在,将原本只能写为scopey为system的jar包,变为非system,从而可以打入到jar包中-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
                <executions>
                    <execution>
                        <id>install-external</id>
                        <phase>clean</phase>
                        <configuration>
                            <file>${java.home}/../lib/tools.jar</file>
                            <repositoryLayout>default</repositoryLayout>
                            <groupId>com.sun</groupId>
                            <artifactId>tools</artifactId>
                            <version>1.8</version>
                            <packaging>jar</packaging>
                            <generatePom>true</generatePom>
                        </configuration>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值