[maven] 将Java swing所依赖的jar复制到一个文件夹

第一步 将swing所依赖的jar复制到一个文件夹内

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-dependency-plugin</artifactId>
	<version>2.9</version>
	<executions>
		<execution>
			<id>copy-dependencies</id>
			<phase>package</phase>
			<goals>
				<goal>copy-dependencies</goal>
			</goals>
			<configuration>
                <outputDirectory>
                  ${project.build.directory}/jmwInvestMigrationLib
                </outputDirectory>
            </configuration>
		</execution>
	</executions>
</plugin>



第二步 将mainClass 与classpathPrefix写入META-INF

<plugin>
	<artifactId>maven-jar-plugin</artifactId>
	<version>2.5</version>
	<configuration>
		<finalName>jmwInvestMigration</finalName>
		<archive>
			<manifest>
				<addClasspath>true</addClasspath>
				<mainClass>com.itdcl.jmw.migration.swing.MigrationUI</mainClass>
				<classpathPrefix>jmwInvestMigrationLib</classpathPrefix>
			</manifest>
		</archive>
	</configuration>
</plugin>



你可能感兴趣的:([maven] 将Java swing所依赖的jar复制到一个文件夹)