Tôi gặp lỗi sau khi chạy Kiểm tra đơn vị trong IntelliJ: Lỗi: Không tìm thấy hoặc tải lớp chính $ {surefireArgLine}. Tôi đang sử dụng maven và trong pom.xml Tôi có:
<properties>
...
<surefire.argLine />
</properties>
<build>
<plugins>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<!--Sets the VM argument line used when unit tests are run.-->
<argLine>${surefire.argLine}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<executions>
<!--
Prepares the property pointing to the JaCoCo runtime agent which
is passed as VM argument when Maven the Surefire plugin is executed.
-->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!--Sets the path to the file which contains the execution data.-->
<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
<!--
Sets the name of the property containing the settings
for JaCoCo runtime agent.
-->
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
...
Có ai có vấn đề tương tự không? Làm thế nào để thiết lập giá trị cho surefireArgLine?
Bạn đã bao giờ tìm thấy một sự sollution khác cho điều này? Tôi cần phải chạy nó từ IDE của tôi để có thể sử dụng chế độ gỡ lỗi. – LisaMM
Unfortunatelly Tôi đã không tìm thấy một giải pháp cho việc này. – BlueLettuce16
@LisaMM bạn có thể gỡ lỗi kiểm tra mà không cần chạy thử nghiệm trong một IDE. Chỉ cần bắt đầu các bài kiểm tra với * mvnDebug * trên dòng lệnh. Sau đó, sử dụng IDE yêu thích của bạn để kết nối với quá trình dòng lệnh. Google cho "gỡ lỗi từ xa" trong IDE yêu thích của bạn. – jah