assembly.xml配置及maven的pom中引入assembly插件

<assembly
	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
	<id>bin</id>
	<formats>
		<format>zip</format>
	</formats>

	<includeBaseDirectory>false</includeBaseDirectory>

	<dependencySets>
		<dependencySet>
			<scope>runtime</scope>
			<outputDirectory>fileController/lib</outputDirectory>
			<excludes>
				<exclude>junit*</exclude>
			</excludes>
		</dependencySet>
	</dependencySets>


	<fileSets>
		<fileSet>
			<directory>../fileController/target</directory>
			<includes>
				<include>*.jar</include>
			</includes>
			<outputDirectory>fileController/lib</outputDirectory>
		</fileSet>
		<fileSet>
			<directory>../fileController/log</directory>
			<outputDirectory>fileController/log</outputDirectory>
		</fileSet>
	</fileSets>
	<files>
		<file>
			<source>../fileController/start.bat</source>
			<outputDirectory>fileController/bin</outputDirectory>
			<destName>start.bat</destName>
			<fileMode>777</fileMode>
			<lineEnding>dos</lineEnding>
		</file>
		<file>
			<source>../-fileController/start.sh</source>
			<outputDirectory>fileController/bin</outputDirectory>
			<destName>start.sh</destName>
			<fileMode>777</fileMode>
			<lineEnding>unix</lineEnding>
		</file>
		<file>
			<source>../fileController/version.txt</source>
			<outputDirectory>fileController</outputDirectory>
			<destName>version.txt</destName>
			<fileMode>755</fileMode>
			<lineEnding>keep</lineEnding>
		</file>
		<file>
			<source>../fileController/src/main/resources/log4j.xml</source>
			<outputDirectory>fileController/config</outputDirectory>
			<lineEnding>dos</lineEnding>
			<fileMode>755</fileMode>
		</file>
		<file>
			<source>../fileController/src/main/resources/config.properties</source>
			<outputDirectory>fileController/config</outputDirectory>
			<lineEnding>dos</lineEnding>
			<fileMode>755</fileMode>
		</file>
	</files>

</assembly>

 

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>assembly.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>assembly</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.8</version>
			</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}/lib
							</outputDirectory>
							<stripVersion>true</stripVersion>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-dependency-plugin</artifactId>
										<versionRange>[2.0,)</versionRange>
										<goals>
											<goal>copy-dependencies</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<distributionManagement>
		<repository>
			<id>releases</id>
			<name>releases</name>
			<url>http://172.19.0.117:8081/nexus/content/repositories/releases</url>
		</repository>
		<snapshotRepository>
			<id>snapshots</id>
			<name>netutel snapshots</name>
			<url>http://172.19.0.117:8081/nexus/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

 

你可能感兴趣的:(assembly)