欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

java小技巧三

程序员文章站 2022-04-28 15:36:29
...

ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project F

 

解决办法:

一是命令行,

mvn clean package -Dmaven.test.skip=true
二是写入pom文件,
<plugin>  
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-surefire-plugin</artifactId>  
        <version>2.4.2</version>  
        <configuration>  
          <skipTests>true</skipTests>  
        </configuration>  
</plugin>  

 

Maven Install报错:Perhaps you are running on a JRE rather than a JDK?

参考文章https://www.jianshu.com/p/1ed0ec397575 搞定

 

default-war) on project Fruit-Sales-Platform: Error assembling WAR: webxml attribute is required 

<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.4.2</version>
				<configuration>
					<skipTests>true</skipTests>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<!-- 指定web.xml的路径 -->
					<webXml>WebRoot\WEB-INF\web.xml</webXml>
					<!-- 指定jsp、js、css的路劲 -->
					<warSourceDirectory>WebRoot</warSourceDirectory>
				</configuration>
			</plugin>
			<!--Tomcat7插件 -->
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<uriEncoding>UTF-8</uriEncoding>
					<path>/</path>
					<port>80</port>

				</configuration>
			</plugin>

		</plugins>
	</build>

 

相关标签: 小技巧