0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

mavenでspotbugsが急に動かなくなった話

Posted at

昨日まであんなに元気にビルドできていたのに急に何故こんなことに。ぴえん。
っていうのはよくある話です。

私もいつものようにバグチェックで mvn spotbugs:sptbugs
ってコマンド叩いたらなんか、エラー出た。

なんかエラー
PS C:\Users\hoge\source\repos\hoge-prj> mvn spotbugs:spotbugs
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.852 s
[INFO] Finished at: 2021-06-01T09:52:19+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spotbugs' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\hoge\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'spotbugs' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\hoge\.m2\repository), central (https://repo.maven.apache.org/maven2)]
    at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve (DefaultPluginPrefixResolver.java:95)
(中略)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

最初は、pom.xmlの記載不備とか社内ネットワークproxyが不通になったのかとか色々調べたけど
ハタと気づいて、コマンド発行するパスを間違えてるのではってことで、

PS C:\Users\hoge\source\repos\hoge-prj> cd .\JavaProject\
PS C:\Users\hoge\source\repos\hoge-prj\JavaProject> mvn spotbugs:spotbugs

[INFO] Fork Value is true
[INFO] Done SpotBugs Analysis....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  07:26 min
[INFO] Finished at: 2021-06-01T10:05:23+09:00
[INFO] ------------------------------------------------------------------------

ってことで、無事に動きました。
どうやら、pom.xmlが存在するパスでやらないとダメっぽかったです。
mvn compileは、パスが違っていても通っていたので気づけなかった。

みなさん、カレントパスには気を付けましょう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?