• maven插件maven-jar-plugin


    maven-jar-plugin将指定包目录打成单独的jar包

    项目依赖的所有jar包导出到lib目录下
    <build>
        <plugins>
         <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <useUniqueVersions>false</useUniqueVersions>
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>cn.xk.dp.weixin.Driver</mainClass>
                        </manifest>
                        <manifestEntries>  <!--将ojdbc8-1.0.jar写进MANIFEST.MF文件中的Class-Path-->
                           <Class-Path>lib/ojdbc8-1.0.jar</Class-Path>
                        </manifestEntries> 
                    </archive>
                    <excludes>   <!--排除用于测试的日志配置资源文件-->
                        <exclude>log4j2-test.xml</exclude>
                    </excludes>
                </configuration>
           </plugin>
        <!--在打包阶段将依赖的jar包导出到lib目录下-->   
        <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>
              <type>jar</type>
              <includeTypes>jar</includeTypes>
              <outputDirectory>${project.build.directory}/lib</outputDirectory>
            </configuration>
            </execution>
          </executions>
         </plugin>
      </plugins>
    </build>    
  • 相关阅读:
    QtDBus编程详解
    QProcess详解
    python 爬虫 亚航 指定日期间的航线
    python 模块
    centos postgres 安装、远程连接
    python 爬虫 anyproxy
    python_scrapy_filespipe重写
    python_xpath
    常见问题汇总
    python_scrapy_log日志
  • 原文地址:https://www.cnblogs.com/wangbin2188/p/14266203.html
Copyright © 2020-2023  润新知