Maven build error "Access is denied"

Maven build error "Access is denied"

book

Article ID: KB0078126

calendar_today

Updated On:

Products Versions
TIBCO Streaming -

Description

I am performing a normal build with maven targets "clean install". I get this error:
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.0:merge-maven-repos (default-cli) on project standalone-pom: 
Error during performing repository copy: PUT request to: com/tibco/ep/sb/thirdparty/com/alibaba/fastjson/1.2.8/fastjson-1.2.8.jar
in target failed: C:\Users\myuser\.m2\repository\com\tibco\ep\sb\thirdparty\com\alibaba\fastjson\1.2.8\fastjson-1.2.8.jar 
(Access is denied) -> [Help 1]

 

Issue/Introduction

Steps to correct this error

Resolution

The typical reason for the "access is denied" error is because the file is protected by access control permissions which the current user does not have. This error can also occur if the file is currently opened and locked by a running process. Check to see if either of these conditions exist and correct them before trying the build process again.

This error can occur on the Microsoft Windows operating system if the target artifact directory has a file with the "hidden" attribute and Maven treats this as a file it cannot read or modify. The TIBCO Streaming product includes the command epdev which can be used to manipulate the Maven repository and resolve this condition by removing the problem artifact so it can be re-written without interference.

To clean and restore the local Maven repository use commands:
1. epdev clean-tibco maven
2. epdev offline maven

This may not restore all dependencies required by your project, so also perform a build of your project using the clean and install targets to identify and restore any additional libraries you may need. Complete these steps while connected to the Internet with clear download access to Maven Central (https://repo.maven.apache.org).