3

I'm running mvn dependency:analyze-only & im getting the error below. Can someone point me to the correct config for running the maven dependency analyzer?.

FYI, my project builds fine with maven, so im not sure what its looking for. I also listed my pom.xml for the plugin.

this is the error im getting

[INFO] 
[INFO] --- maven-dependency-plugin:2.10:analyze-only (default-cli) @ MFC ---
[INFO] Skipping project with no build directory

... This is my pom.xml for the dependency plugin ...

<plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze</goal>
            </goals>
            <configuration>
              <failOnWarning>true</failOnWarning>
              <outputDirectory>c:\TEMP\</outputDirectory>
            </configuration>
          </execution>
        </executions>
    </plugin>
Mr Smith
  • 3,318
  • 9
  • 47
  • 85

1 Answers1

1

Note that the dependency:analyze-only goal is used in preference to dependency:analyze since it doesn't force a further compilation of the project, but uses the compiled classes produced from the earlier test-compile phase in the lifecycle.

The project's dependencies will then be automatically analyzed during the verify lifecycle phase

If you have not compiled or run your tests before, you will get that message.

Then you must execute as follows

 >mvn verify dependency:analyze-only

or simply

 > mvn verify

UPDATE

Your pluging goal must be <goal>analyze-only</goal> not <goal>analyze</goal> plugin then must be

<plugin>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.10</version>
    <executions>
      <execution>
        <id>analyze</id>
        <goals>
          <goal>analyze-only</goal>
        </goals>
        <configuration>
          <failOnWarning>true</failOnWarning>
          <outputDirectory>c:\TEMP\</outputDirectory>
        </configuration>
      </execution>
    </executions>
</plugin>

do the change and execute mvn verify dependency:analyze-only or verify and it should works.

Community
  • 1
  • 1
johnnymnmonic
  • 774
  • 8
  • 11
  • 1
    This is not the issue. Running mvn verify dependency:analyze-only or mvn dependency:analyze produces the same "Skipping project with no build directory" message. My project is building fine and I can run it with no issues. I'm assuming im missing a pom setting for the dependency plugin, but what? – Mr Smith Oct 12 '16 at 14:46