maven 打jar 包 并将所有依赖打到jar里面

时间:2021-11-29 13:38:31

http://*.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven


<plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
        <archive>
          <manifest>
            <mainClass>xxx.xxx.Class</mainClass>
          </manifest>
        </archive>
        <descriptorRefs>
          <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>
      </configuration>
    </plugin>
	</plugins>
	<resources>
		<resource>
			<directory>src/main/resources</directory>
			<includes>
				<include>**/*.properties</include>
				<include>**/*.xml</include>
				<include>**/*.tld</include>
			</includes>
			<filtering>false</filtering>
		</resource>

		<resource>
			<directory>src/main/java</directory>
			<includes>
				<include>**/*.properties</include>
				<include>**/*.xml</include>
				<include>**/*.tld</include>
			</includes>
			<filtering>false</filtering>
		</resource>
	</resources>