maven 项目引入lib目录中的jar包

<build>
		<defaultGoal>compile</defaultGoal>
		<sourceDirectory>${basedir}/src</sourceDirectory>
		<outputDirectory>${basedir}/WebRoot/WEB-INF/classes</outputDirectory>
		<resources>
			<resource>
				<directory>${basedir}/src</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<webappDirectory>${basedir}/WebRoot</webappDirectory>
					<warSourceDirectory>${basedir}/WebRoot</warSourceDirectory>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>${java-version}</source>
					<target>${java-version}</target>
					<encoding>UTF-8</encoding>
					<compilerArguments>
						<extdirs>${basedir}/WebRoot/WEB-INF/lib</extdirs>
					</compilerArguments>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.alibaba.citrus.tool</groupId>
				<artifactId>autoconfig-maven-plugin</artifactId>
				<version>1.2</version>
				<configuration>
					<userProperties>${basedir}/WebRoot/META-INF/autoconf/${autoconfig.properties}</userProperties>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>autoconfig</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	  </build>
	
	  <profiles>
		<profile>
		    <!-- 开发环境 -->
		    <!-- 使用方法:mvn package -P dev -Dautoconfig.strict=false -->
			<id>dev</id>
			<properties>
				<autoconfig.properties>antx-dev.properties</autoconfig.properties>
			</properties>
		</profile>
		<profile>
			<!-- 部署环境 -->
			<!-- 使用方法:mvn package -P deploy -Dautoconfig.strict=false -->
			<id>deploy</id>
			<properties>
				<autoconfig.properties>antx-deploy.properties</autoconfig.properties>
			</properties>
		</profile>
		<profile>
			<!-- 本地测试环境 -->
			<!-- 使用方法:mvn package -P pro -Dautoconfig.strict=false -->
			<id>pro</id>
			<properties>
				<autoconfig.properties>antx-pro.properties</autoconfig.properties>
			</properties>
		</profile>
	 </profiles>

没有更多推荐了,返回首页