maven打出附带配置文件的jar包

<dependencies>
   	<dependency>
   		    <groupId>com.yinsin</groupId>
   		    <artifactId>YsJConsole</artifactId>
   		    <version>0.0.1-SNAPSHOT</version>
   		    <scope>system</scope>   <systemPath>C:/Users/Administrator/Desktop/project/lightos/lib/YsJConsole-0.0.1-SNAPSHOT.jar</systemPath>
   		</dependency>
   
   
       <project xmlns="http://maven.apache.org/POM/4.0.0"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0    http://maven.apache.org/xsd/maven-4.0.0.xsd">      <modelVersion>4.0.0</modelVersion>
     <groupId>com.zheng</groupId>   <artifactId>Update</artifactId>      <version>0.0.1-SNAPSHOT</version>   <packaging>jar</packaging>
     <name>Update</name>   <url>http://maven.apache.org</url>
     <properties>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>      </properties>
   
     <dependencies>
     <dependency>  <groupId>javax.activation</groupId>  <artifactId>activation</artifactId>  <version>1.1</version>    </dependency> <dependency>  <groupId>javax.mail</groupId>     <artifactId>mail</artifactId>  <version>1.4</version> </dependency>
       <dependency>
           <groupId>mysql</groupId>
           <artifactId>mysql-connector-java</artifactId>
           <version>5.1.39</version>
       </dependency>
       <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.1</version>
     <scope>test</scope>    </dependency>   </dependencies>
 
 
    <build> <plugins>
         <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-jar-plugin</artifactId>
       <configuration>
         <outputDirectory>${project.build.directory}/java</outputDirectory>
         <archive>
           <manifest>
             <addClasspath>true</addClasspath>
             <classpathPrefix>lib/</classpathPrefix>
             <mainClass>com.zheng.Update.update</mainClass>
           </manifest>
           <manifestEntries>
             <Class-Path>.</Class-Path>
           </manifestEntries>
         </archive>
         <excludes>
           <exclude>**/*.xml</exclude>
           <exclude>**/*.conf</exclude>
           <exclude>**/*.properties</exclude>
         </excludes>
   
       </configuration>
     </plugin>
     <!-- maven资源文件复制插件 -->
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-resources-plugin</artifactId>
       <version>2.7</version>
       <executions>
         <execution>
           <id>copy-resources</id>
           <!-- here the phase you need -->
           <phase>package</phase>
           <goals>
             <goal>copy-resources</goal>
           </goals>
           <configuration>
             <outputDirectory>${project.build.directory}/java</outputDirectory>
             <resources>
               <resource>
                 <directory>src/main/resources</directory>
                 <includes>
                   <exclude>**/*.xml</exclude>
                   <exclude>**/*.conf</exclude>
                   <exclude>**/*.properties</exclude>
                 </includes>
                 <filtering>true</filtering>
               </resource>
             </resources>
             <encoding>UTF-8</encoding>
           </configuration>
         </execution>
       </executions>
     </plugin>
     <!-- 依赖包插件 -->
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-dependency-plugin</artifactId>
       <executions>
         <execution>
           <id>copy-dependencies</id>
           <phase>package</phase>
           <goals>
             <goal>copy-dependencies</goal>
           </goals>
           <configuration>
             <outputDirectory>${project.build.directory}/java/lib</outputDirectory>
             <!-- 是否不包含间接依赖 -->
             <excludeTransitive>false</excludeTransitive>
             <!-- 忽略版本 -->
             <stripVersion>false</stripVersion>
           </configuration>
         </execution>
       </executions>
     </plugin>
   
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <version>2.18.1</version>
       <configuration>
         <skipTests>true</skipTests>
       </configuration>
     </plugin>
   
       </plugins>
   
    </build> </project>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值