Maven中配置maven-compiler-plugin插件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Maven中配置maven-compiler-plugin插件相关的知识,希望对你有一定的参考价值。

   这个插件就如同名字所显示的这样,用来编译源代码的。

加载第三方包

<dependency>
			<groupId>cn.eshore.bnet</groupId>
			<artifactId>UDBClient</artifactId>
			<version>1.0-SNAPSHOT</version>
			<scope>system</scope>
			<systemPath>${basedir}/lib/UDBClient-1.0-SNAPSHOT.jar</systemPath>
		</dependency>

  

<pluginManagement>
			<plugins>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.7</source>
						<target>1.7</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>2.8</version>
					<configuration>
						<excludeScope>provided</excludeScope>
						<excludeTransitive>false</excludeTransitive>
						<includeScope>compile</includeScope>
						<outputDirectory>target/lib</outputDirectory>
					</configuration>
					<executions>
						<execution>
							<id>copy</id>
							<phase>package</phase>
							<goals>
								<goal>copy-dependencies</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.4</version>
					<configuration>
						<excludes>
							<exclude>**/*.properties</exclude>
							<exclude>**/*.xml</exclude>
						</excludes>
					</configuration>

				</plugin>
			</plugins>
		</pluginManagement>

  

以上是关于Maven中配置maven-compiler-plugin插件的主要内容,如果未能解决你的问题,请参考以下文章

如何更改 IntelliJ IDEA 默认 JDK?

如何在myeclipse中配置maven本地仓库

JavaEE环境配置 - 配置Maven: 在eclipse中配置Maven

JavaEE环境配置 - 配置Maven: 在eclipse中配置Maven

MyEclipse中maven的配置

关于maven中配置远程仓库的问题