Maven resources compiler: Failed to copy xx to yy: Couldn't copy xx to yy - maven

Getting the following error during build/rebuild in Intellij v.2022.2.3.
Maven resources compiler: Failed to copy 'absolute_path_to_module/src/test/test-resources/test-app-camel-settings.properties' to 'absolute_path_to_module/target/test-classes/.': Couldn't copy [absolute_path_to_module/src/test/test-resources/test-app-camel-settings.properties] to [absolute_path_to_module/target/test-classes/.]
Tried the following but still getting the same issue:
build and rebuild project/module
mvn clean install
invalidate caches and restart
reverted all project changes to last time it was working
Was working earlier, only made normal code changes

Solved it by deleting the old resources folder and creating a new one

Related

Maven failed to clean project while building a second time

I'm facing a very strange behavior on my laptop...
I have a maven project (loaded with Visual Studio Code) building a WAR file to be deployed on a remote server.
Project compilation worked properly since yesterday but today, I'm only able to launch only once the clean install...until I reboot my laptop...
here is the command launched (the second time which cause the error):
mvn clean
....
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project my-backend: Failed to clean project: Failed to delete M:\dev\my-backend\target\my-backend\WEB-INF\lib\plexus-utils-3.3.0.jar -> [Help 1]
I'm trying to delete the target folder manually but It seems that there is another program who access this folder but I do not have anything running on my laptop, no server, no IDE (I Stopped Visual Studio Code).
I even tried to close every windows (even GitBash used to launch mvn commands) but I'm still getting this lock file issue....the only solution is to reboot my laptop !
since yesterday I didn't change anything on my pom.xml file...I'm really stucked...
EDIT 1:
I also checked with other Maven Projects I have and I'm getting the same result. After reboot I can build (mvn clean and mvn install) without any problem but at the end of the build, Windows is adding a lock on the files target/my-backend/WEB-INF/lib
Even if I try to unlock the lib folder (with UnlockIT for instance) the unlock cannot be performed and there is no process handling the lock...
any idea why I'm getting this lock and how to remove it ?

Could not download org.springframework.vault

I am importing the gradle project in eclipse which is the spring boot application. I could see all the dependency jars are downloaded except "org.springframework.vault".
I could download the spring-vault-core-2.0.1.RELEASE.pom file from browser, so no network issues i guess.
When i checked in D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1 i could not find this directory. I tried to create this directory but i got the error pop up says "folder/file in it is open in other program". I have restarted the pc, also killed all the java process and tried to create this dir, but still failed.
I deleted the cache directory itself and did gradle build, it downloaded the jars freshly except the mentioned one.
code cannot be shared as it is working project.
when i ran the application getting the error
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
Could not resolve org.springframework.vault:spring-vault-core:2.0.1.RELEASE.
Required by:
project : > com.gogoair.ps:xauth-security:2.0.4
Could not resolve org.springframework.vault:spring-vault-core:2.0.1.RELEASE.
Could not get resource 'https://jcenter.bintray.com/org/springframework/vault/spring-vault-core/2.0.1.RELEASE/spring-vault-core-2.0.1.RELEASE.pom'.
Failed to move file 'C:\Users\CHE32904\AppData\Local\Temp\gradle_download5901172107951949118bin' into filestore at 'D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1\org.springframework.vault\spring-vault-core\2.0.1.RELEASE\562973b9fcc1880af51f50b2d1a53cf8b9f2745c\spring-vault-core-2.0.1.RELEASE.pom'
Failed to create parent directory 'D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1\org.springframework.vault' when creating directory 'D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1\org.springframework.vault\spring-vault-core\2.0.1.RELEASE\562973b9fcc1880af51f50b2d1a53cf8b9f2745c'

Cannot find snapshot for id: gradle

I'm getting error of cannot find snapshot for id while building the project.
on running the command ./gradlew build --info I received the information saying that PROJECT_FOLDER/build/libs/projectName.jar has been removed.
I tried to look for the same, but its generating the jar at said location.
It was running fine till yesterday all of a sudden started facing this issue.
Now, I have no clue how should I go ahead finding the root cause.
Any suggestion would be really appreciated.
I'm using gradle 4.2.1 for building the project
Could you please try to remove .gradle directory from your project and build your gradle again

Bamboo build error: How to properly clean bamboo caches?

The problem:
Bamboo executes old unit tests that don't exist my current develop branch which causes a build error.
The situation that causes this problem:
After a big refactoring process of my maven java project, where I basically moved, modified and renamed every file, I committed my changes to my remote repository.
That triggered my bamboo build plan, to start the build process.
The git code checkout seems to work, but the next step, running the unit tests, fails!
Looking in the log file I see that an old, no more existing java Unit test class gets executed and of course fails because of NullPointerExceptions.
Things I tried to fix this problem
A. Remove caches in the Administration section
I went to Bamboo->Administration->Repository Settings and selected
the cache of my project and deleted it.
I started the build plan again
BUILD ERROR ! Same problem
B. Delete the cache directory in the file system
Start a RDP session on the bamboo server
stop bamboo
go to D:\bamboo-home_64\xml-data\build-dir_git-repositories-cache
delete all files in this folder
start bamboo
start the build plan again
BUILD ERROR! same problem
Meta info
bamboo version: 6.1.0 build 60103 - 18 Jul 17
I don't know what I can do to fix this..
There's Clean working directory task. Add it as first task to your Job and see if it solves the issue.

Trying to compile an XCode project with a workspace on Jenkins slave

I got a Jenkins slave building single xcode projects, working perfectly.
However, I got a project with a workspace where some 3rd party files are setup in the root of the workspace with a gitmodule then imported in to the project as described here.
When Jenkins compiles and reaches AppDelegate.h it throws and error when trying to import a file from the library.
fatal error: 'RestKit/Restkit.h' file not found #import <RestKit/Restkit.h>
I got the project compiling by pointing to the workspace. However it now fails when reaches the packaging stage. I don't see the build directory created in the workspace.
** BUILD SUCCEEDED **
Cannot remove *.ipa files from a non-existing directory:
/Users/leon/Work/projects/wearehive/flatstr/build/Flatstr/dev/jenkins/workspace/Snug-debuOLD/build/Debug-iphoneos
Packaging IPA
FATAL: null
java.lang.NullPointerException
at au.com.rayh.XCodeBuilder.perform(XCodeBuilder.java:421)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:705)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
at hudson.model.Run.run(Run.java:1434)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Your Project=>build settings=>Header Search Paths, add follow path:
"$(SOURCE_ROOT)/RestKit/Build/Headers"
Be sure checked box in front of them.
I use xcode plugin and use this for SYMROOT value instead of space fixes the problem.
${workspace}/build/[app name]/Build/Products

Resources