【发布时间】:2020-02-06 12:42:29
【问题描述】:
我们公司有自己的 maven 存储库,我们从那里下载 maven 依赖项。当我在命令行上运行 maven clean test 时,它不会从 java 文件生成目标类和测试类。
问题:
- 目标 > 测试类 没有运行 mvn clean test 时生成的 .class 文件。
请帮忙。谢谢。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Automation-Framework</groupId>
<artifactId>Automation-Framework</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<includes>
<include>ChromeTestManager.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
命令行输出:
[INFO] Scanning for projects [INFO] Deleting target folder
[INFO] --- maven-clean-plugin:2.6:resources (Default resources) @ Automation Framework
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent
[INFO] --- maven-compiler-plugin:3.1:compile
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent
[INFO] --- maven-resources-plugin:2.6:testResources [INFO] Copying 0 resource [INFO] --- maven-compiler-plugin:3.1testCompile [INFO] Nothing to compile - all classess up to date
[INFO] --- maven-surefire-plugin:3.0.0.-M3:test (default-test) @ Automation-Framework
[Info] Build Success
【问题讨论】:
-
你试过
mvn clean install -
请将您构建的命令行输出添加到问题中。
-
@JFMeier ,简单地调用 Clean Test 是行不通的,至少他应该有一个安装阶段来获取本地保存的编译文件。
-
添加了命令行输出。
-
@VishwaRatna 不,它会工作 - 编译是之前的测试并且会完成。