jeudi 25 juin 2020

Found used undeclared dependencies junit 4.13 when I use junit 5

I'm moving from junit 4 to junit 5. I ran into a problem when analyzing dependencies. when I run mvn dependency:analyze, an error occurs:

[WARNING] Used undeclared dependencies found:
[WARNING]    junit:junit:jar:4.13:test
[INFO] Add the following to your pom to correct the missing dependencies: 
[INFO] 
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.13</version>
  <scope>test</scope>
</dependency>

My pom.xml

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
            <ignoredDependencies>
              <ignoredUsedUndeclaredDependencies>junit:junit:jar:4.13</ignoredUsedUndeclaredDependencies>
            </ignoredDependencies>
            </configuration>
          </execution>
        </executions>
      </plugin>

<dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>

Please help us eliminate this error

Aucun commentaire:

Enregistrer un commentaire