プロジェクトのビルドには Maven を使用し、UT コード カバレッジ コレクションには cobertura を使用しています。私の問題は、プロジェクトをビルドしようとしたときに、以下のエラーが発生したことです。最終的に、コマンドを発行したときに cobertura プラグインが原因であることがわかりましたmvn cobertura:instrument
。
[INFO] Unable to obtain CommandsFile location.
Embedded error: Permission denied
ディレクトリを調べてみましたが、許可があると思います。失敗を見た人はいますか?それをデバッグする方法は?
$ mvn cobertura:instrument
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] MyProject
[INFO] ------------------------------------------------------------------------
[INFO] Building XXXXXX
[INFO] task-segment: [cobertura:instrument]
[INFO] ------------------------------------------------------------------------
[INFO] [cobertura:instrument]
[INFO] Skipping cobertura mojo for project with packaging type 'pom'
[INFO] ------------------------------------------------------------------------
[INFO] Building ato-client
[INFO] task-segment: [cobertura:instrument]
[INFO] ------------------------------------------------------------------------
[INFO] [cobertura:instrument]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to obtain CommandsFile location.
Embedded error: Permission denied
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to obtain CommandsFile location.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to obtain CommandsFile location.
at org.codehaus.mojo.cobertura.tasks.AbstractTask.executeJava(AbstractTask.java:195)
at org.codehaus.mojo.cobertura.tasks.InstrumentTask.execute(InstrumentTask.java:131)
at org.codehaus.mojo.cobertura.CoberturaInstrumentMojo.execute(CoberturaInstrumentMojo.java:145)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
... 16 more
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1792)
at java.io.File.createTempFile(File.java:1828)
at net.sourceforge.cobertura.util.CommandLineBuilder.<init>(CommandLineBuilder.java:96)
at org.codehaus.mojo.cobertura.tasks.CommandLineArguments.getCommandsFile(CommandLineArguments.java:82)
at org.codehaus.mojo.cobertura.tasks.AbstractTask.executeJava(AbstractTask.java:191)
... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Jan 22 09:30:25 CST 2013
[INFO] Final Memory: 22M/241M
[INFO] ------------------------------------------------------------------------