Maven project is not picking local repository after copying - maven-2

I had a working workspace set up in Maven. Due to unavoidable reasons I have to change my system and hence I need to set up a new workspace. Hence I copied the .m2/repository folder from a working system to the new system.
But unfortunately my local is nopt picking jars from the local repository and it is throwing compiler error. I have copied it to my home directory .m2/repository folder
Can anyone please help me here?
Thanks,
Rengasami R

The local repository path is defined in your settings.xml file (found either in M2_HOME/conf or USER_HOME/.m2). Check that the value of this <localRepository> matches the path you have defined.
Another solution is to run the command mvn help:effective-settings, and it will display the content of the settings.xml Maven is using, so you will find this information easily.

Related

How to to define bamboo artifact so its NOT published in syb folder

The artifact definition and the file structure in the bitbucket repository is as below.
The build when run creates application-dev.properties & safeguard-dev.properties under classes folder. When i click them it takes me to classes folder inside which the property files are present. But i want them to be published directly like the jar. So that when I click the file it should download. But if i give full path it errors out. Please help me how to define this?
error 19-Dec-2022 16:34:57 Failing as no matching files has been found and empty artifacts are not allowed.
error 19-Dec-2022 16:34:57 Unable to publish artifact [application-dev.properties]:
error 19-Dec-2022 16:34:57 The artifact is required, build will now fail.
Bamboo won't put the artifacts in a subfolder if the "Location" points to exactly where the files are. I.e. don't use the "**" wildcard in the "Copy pattern". I'd say try even to have a separate artifact per properties file.
Your location is pointing to "workdir/src", but you need "target/classes". Get rid of the $bamboo.build.working.directory: that's not the maven build dir and you don't need it altogether (because current work dir is already set to your project dir). If I get the paths right, this should work:
Name: application-dev.properties
Location: target/classes
Copy pattern: application-dev.properties

resource not found when using IntelliJ

I have a resource abc/xyz.json under src/test/resources. I'm using IntelliJ IDE.
While running a Test for my project, I get the following exception.
Exception
com.google.common.io.Resources.getResource("abc/xyz.json")
fails with java.lang.IllegalArgumentException: resource abc/xyz.json not found.
The Test runs fine with gradle clean build and eclipse
Try marking your src/test/resources folder as Test Resource Root. Attach is the image on how to do it.
Let me know if you need any other information.
Make your resource folder a Test Resource folder, if this does not fix the issue then, close your project, delete target folder and open the project. Hope this helps.
Had the same issue not that long ago, since Intellij outputs the class files into out/production/{project_name}, that path will not start in the src directory but will start in the out/production/{project_name} directory.
It will however see files that are in the project root directory, I'd recommend moving your resource directory into the main project directory then accessing the file with "resources\${FILE_NAME}".
Sometimes I have the same problem, though the folder is marked as resource root. So what I do: I just Unmark it and then mark it as resource root again. Sometimes I need to do it several times and it works. But anyway I think it is Intellij IDEA bug.

Adding external Jar to Pentaho Kettle

I am working on Pentaho Kettle version 5.0.1. In one of my transformation I am using javascript component where I am calling a method located in the JAR which I have copied to the lib folder of data-integration and everything is working fine in my local. But in my dev environment(I run it using kitchen) I don't have permission to copy my Jar file to the lib folder due to the restrictions on the server. Is there any other way using which I can supply the path of my custom Jar during run time so that the Kettle Job/Transformation can use it while being executed. Is there a way Kettle can pick the Jar location other than data-integration/lib?. Any help will be appreciated.
Take a look into kitchen.sh (and pan.sh). At some point the script starts adding stuff to the classpath. You can add more folders to the classpath there.
You still need permissions to edit the kitchen.sh file, though. If you can't do that, I suggest creating a copy of kitchen.sh you can write, in a separate location, and change the $BASEDIR folder to the actual PDI installation, so that kitchen can be located elsewhere.
If you have permission you can put your jar in another directory and after you specify this directory in the launcher.properties which you find in data-integration\launcher.
For exemple: if you put your jar in this directory: /export/home.
In launcher.properties: you will add this path and precisely libraries=../test:../lib:../libswt:../export/home

IntelliJ Idea - resource SQL files not being copied to target

I have some problems with IntelliJ Idea not copying SQL resource files into target directory, so I have to copy them there manualy.
I have SQL reosurce pattern in project's compiler settings.
I have standart structure maven project - with /etc/ folder holding property files which gets copied without problem. /etc/ folder holds /sql/ folder which i need to be copied as well, but it gets not copied at all. /etc/ folder is set as source folder.
My folder structure:
-etc
-conf
-sql
-src
-main
-test
This should work fine, but could be a bug specific to your configuration. Could you please submit an issue with a sample project and pom.xml?

Bamboo artifacts

I am very new to Bamboo. I have got a html file generated using log4j. I wish to put it in user-defined artifacts but don't know how.
It is in surefire-reports folder so I tried giving Source directory as "**/target/surefire-reports/" and Artifact Copy Pattern as "**/*.html" but it doesn't seems to work.
Any idea how to configure it?
Try to change copy pattern to
*.html
and verify your complete path.
I wanted to get all surefire reports from each module, so I created a new Artifact definition with:
Name = Surefire Reports
Location =
Copy Pattern = /target/surefire-reports/.*
This was using Bamboo 3.2.2.
The Location field does not provide the Ant file copy pattern feature, only a fixed path is accepted relative to the working directory.
Set the Location as target/surefire-reports
and the Copy pattern as **/*.html
Also make sure that the Shared checkbox is set, otherwise other jobs will not be able to download the artifact.