Java 无法执行目标org.apache.maven.plugins(权限被拒绝)

Java 无法执行目标org.apache.maven.plugins(权限被拒绝),java,maven,Java,Maven,我在ubuntu 14.04上构建maven项目时遇到了这个错误。我的命令:mvn-liferay:build-service编译包 之后,我使用sudo:$sudomvnliferay:buildservice编译包运行 权限,但仍然无法解决此问题,请帮助我。文件可能已被其他进程锁定: 执行lsof/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/mysql-connector-java-5.1.21.jar 查看哪个进程可能持有独占锁。看起来您正在通过

我在ubuntu 14.04上构建maven项目时遇到了这个错误。我的命令:mvn-liferay:build-service编译包

之后,我使用sudo:$sudomvnliferay:buildservice编译包运行
权限,但仍然无法解决此问题,请帮助我。

文件可能已被其他进程锁定:

执行lsof/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/mysql-connector-java-5.1.21.jar
查看哪个进程可能持有独占锁。

看起来您正在通过绝对路径使用依赖项,这绝不是一个好主意。最好开始使用存储库管理器,并将此类工件部署到单独的存储库中。这会解决很多头疼的问题。谢谢你,这对我有用。
Writing /home/hien/bitnemo/gtsportlets/gts-portlet-service/src/main/java/com/gts/portlets/eventdata/service/persistence/EventDataPersistence.java
    Writing /home/hien/bitnemo/gtsportlets/gts-portlet-service/src/main/java/com/gts/portlets/eventdata/service/persistence/EventDataUtil.java
    Writing /home/hien/bitnemo/gtsportlets/gts-portlet-service/src/main/java/com/gts/portlets/eventdata/model/EventDataWrapper.java
    Building EventOverSpeed
    Building EventPTO
    Building FnolDetail
    Building FnolMainEvent
    Building GeoCorridor
    Building GeoCorridorList
    Building Geozone
    Building Pushpins
    [INFO] 
    [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ gts-portlet-service ---
    [debug] execute contextualize
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory /home/hien/bitnemo/gtsportlets/gts-portlet-service/src/main/resources
    [INFO] 
    [INFO] --- maven-compiler-plugin:2.5:compile (default-compile) @ gts-portlet-service ---
    [INFO] Compiling 321 source files to /home/hien/bitnemo/gtsportlets/gts-portlet-service/target/classes
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] error: error reading /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/mysql-connector-java-5.1.21.jar; /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/mysql-connector-java-5.1.21.jar (Permission denied)
    [INFO] 1 error
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO] 
    [INFO] gts ............................................... SUCCESS [  1.263 s]
    [INFO] gts Portlet Service ............................... FAILURE [02:23 min]
    [INFO] WTP Portlet ....................................... SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 02:25 min
    [INFO] Finished at: 2014-10-23T08:53:09+07:00
    [INFO] Final Memory: 56M/263M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project gts-portlet-service: Compilation failure
    [ERROR] error: error reading /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/mysql-connector-java-5.1.21.jar; /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/mysql-connector-java-5.1.21.jar (Permission denied)
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [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/MojoFailureException
    [ERROR] 
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :gts-portlet-service
    hien@hien-eME730G:~/bitnemo/gtsportlets$ sudo mvn liferay:build-service compile package
    [INFO] Scanning for projects...
    [ERROR] The build could not read 1 project -> [Help 1]
    [ERROR]   
    [ERROR]   The project com.example.plugins:gts:1.0.0-SNAPSHOT (/home/hien/bitnemo/gtsportlets/pom.xml) has 1 error
    [ERROR]     'build.plugins.plugin.version' for com.liferay.maven.plugins:liferay-maven-plugin must be a valid version but is '${liferay.maven.plugin.version}'. @ line 16, column 14
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [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/ProjectBuildingException