• Maven打包包含jar包


     <build>
            <resources>
                <resource>
                    <directory>src/main/resources/assembly/</directory>
                    <includes>
                        <include>conf/**</include>
                    </includes>
                    <filtering>true</filtering>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler.plugin.version}</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <target>${jdk.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>
                                    ${project.build.directory}/lib
                                </outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
    
                <!--            <plugin>-->
    <!--                <artifactId>maven-assembly-plugin</artifactId>-->
    <!--                <configuration>-->
    <!--                    <descriptorRefs>-->
    <!--                        <descriptorRef>jar-with-dependencies</descriptorRef>-->
    <!--                    </descriptorRefs>-->
    <!--                    <archive>-->
    <!--                        <manifest>-->
    <!--                            <mainClass></mainClass>-->
    <!--                        </manifest>-->
    <!--                    </archive>-->
    <!--                </configuration>-->
    <!--                <executions>-->
    <!--                    <execution>-->
    <!--                        <id>make-assembly</id>-->
    <!--                        <phase>package</phase>-->
    <!--                        <goals>-->
    <!--                            <goal>single</goal>-->
    <!--                        </goals>-->
    <!--                    </execution>-->
    <!--                </executions>-->
    <!--            </plugin>-->
            </plugins>
        </build>
    

      

  • 相关阅读:
    B1031
    B1021
    B1021
    B1021
    Android 系统服务一览表
    MULTI-INTERFACE CONNECTIVITY ON ANDROID
    ConnectivityManager 确定和监控网络连接状态
    Android系统各种类型的service刨根解读
    Android Netd
    Android am 指令的使用
  • 原文地址:https://www.cnblogs.com/irobotzz/p/15466797.html
Copyright © 2020-2023  润新知