I use Atlassian Bamboo's Maven 3.x task, and have encrypted p/w's in my settings.xml file. In the Maven task, I pass the "-s /path_to/settings.xml" switch to tell Maven where my settings.xml file is. However, this looks for /root/.m2/settings-security.xml file, but I can't write the file in the /root/... path. How do I make my Maven task look for the settings-security.xml file somewhere else?
Or is there a better solution to this than what I'm doing?
Related
I have a build jar in Jenkins .I need to deploy the jar into windows VM Machine..I have tried lot of options but i couldn't achieve. Kindly suggest me .. Guidance much appreciate.
I assume that your have an Spring boot executable jar. I'm also assuming that you have jar file located in central repo such as Nexus or Artifactory.
In this case, create a write declarative or scripted pipeline. In one of the build steps execute a batch file with the command below.
java -jar <YourJarFile>.jar
Also make sure the installed java version classpath is set.
I'm very new with Jenkins. I have tried to run projects on Jenkins but all are fail. I don't know whether the configuration is wrong or something. I have read the instruction on the jenkins-ci.org but I didn't understand anything. Anyone can give me a demo with Java project? By the way, show me the Jenkins configuration. Thanks all!
First question, do you want to build a Maven project?
If the answer is yes, you can create a new job with this template "Build a maven project".
You just have to configure your SCM tool (Git, SVN, ...) and when you want to pool your code (cron tab).
Next, in the build section, you have to declare your Maven goals (clean install for example) and the pom.xml file location (if the pom.xml file is not in the root folder).
That's all.
I am trying to deploy from Jenkins to Archiva. I'm not very sure how it all works. I have a maven project and I have read that I need to change a settings.xml file. I cannot find such a file in my Archiva 2.0 directories.
While in Jenkins I am using the ArtifactDeployer plugin. When I try to enter the directory from which to get the artifacts there is an error saying it does not exist.
How can I resolve this problem?
Within Jenkins, you need to register the build tools that Jenkins will use.
In regard to the buld tool Maven, I suggest:
Download, unzip, and install Apache Maven to the server on which Jenkins runs.
Configure your Maven's conf/settings.xml to point to your Archiva installation.
Configure the M2_HOME and PATH variables so that the mvn command can be executed.
Configure Jenkins to use the Apache Maven installation that you just configured.
The point is, that's a sure fire way to locate and edit a settings.xml file.
If you have Jenkins download Maven for you (I generally don't do this), then you'll have to look for a path to where Jenkins installed Maven.
The ivy local repository is in ~/.ivy2, and I'd like to use it as my local maven respoitory. Is there any easy way like setting to do it ?
I suspect what you're trying to do is share ivy's cache, not it's local repository. Files are placed in ivy's repository by calling the publish task. Ivy has a clear storage distinction between these file types:
~/.ivy2/cache
~/.ivy2/local
Maven on the other hand mixes up both file types under the following directory:
~/.m2/repository
It would be a lot simpler to optimize your caching by installing a Maven repository manager like Nexus and configuring Maven and Ivy to use it. Nexus is a very efficient java process and simple to setup on your development machine.
Finally if you are determined to share caches, you could attempt to use the caches directive in the ivy settings file. It has "ivyPattern" and "artifactPattern" directives which suggest one can customize how the cached files are stored. To make this work you'll have to customize ivy. Maven has no flexibility in this area.
Does anyone know how to exclude files or directories using the Jenkins Clover plugin? The report it is producing includes files under src/test which is causing the results to be skewed.
btw. I'm using Ant to build the project (as opposed to Maven). Should I be adding the block in the ant build file?
http://jenkins-php.org/ was helpful for ant/jenkins setup. I did change the build.xml for phpunit. I added the following code to the phpunit exec task <arg line="${basedir}/path/to/tests"/>. To point only to my test folder which I have in the jenkins workspace.
To exclude folders/files from clover reports. You need to have a phpunit config file. Name it phpunit.xml.dist and keep that with your build file. There is more info and an example on the link above. Add the following code to the phpunit.xml.dist file. Hope this helps.
<filter>
<blacklist>
<directory>PATH/TO/FOLDER/</directory>
<file>PATH/TO/File</file>
</blacklist>
</filter>
Link to phpunit confing file manual.
http://www.phpunit.de/manual/current/en/appendixes.configuration.html