How to access SVN repository on another computer using Windows Credentials from Jenkins - windows

We are on a LAN. One of our computers has Jenkins installed. On another computer in the same LAN is our SVN repository. The repository is only accesible after we login to the server using username and password.
How can we setup our computer so Jenkins can login to the server and see when our SVN repository receives new commits etc?

Install Jenkins SVN plugin (Hpi file format) from jenkins site and after installing Jenkins svn plugin, you have to restart the Jenkins. You will find the check box for every successive changes or commit, it will start building the application.

Related

Continuous Integration with Jenkins - clarifications

We are planning to implement continuous integration with Jenkins software, so we successfully installed Jenkins in our server (windows platform)
My question was
How can I manage (keep) my source code?
How can we configure if the source code located in some other machine / server / cloud
Our current process
Jenkins, source code is available in same machine, so we created a project in Jenkins and map the pom.xml (like D:\pom.xml) file under build section.
Choose a Version control tool, consider that SVN and GIT are quite different (Git--> Distributed system, SVN-> Centralized system) so read a bit about them before choose, then check for the availability of GIT/SVN plugin in Jenkins unless it already contained in your Jenkins installation.
Put the code under SVN/GIT, follow the standards, configure Jenkins in order to access to SVN/GIT server.
Check how to configure maven with Jenkins, it has a great integration with Maven.
Maven Jenkins:
https://www.tutorialspoint.com/jenkins/jenkins_maven_setup.htm
Jenkins Git:
Jenkins and Git sparse checkouts
The flow of the single build job is:
Checkout The code,
Specify the folder with the pom.xml file
Run the maven goal you need (e.g. mvn install)
You put your source code into Subversion or Git. Then you give your Jenkins access to the Subversion/Git and point it to the URL which you want to checkout.
Answer to first question : Host your code in a SVN or GIT repository. Git has higher market share than SVN because of large feature set and higher efficiency. SVN is simple and easy to use for new comers in the version control territory. Explore the options and host the corresponding server in your infrastructure.
Answer to second question : There are multiple plugins available in Jenkins to fetch code from remote repositories. For git , there is git client, gitlab and gitHub plugin . For SVN there is Polarion webClient for SVN plugin.

Where is maven local repository, if the process is executed by windows SYSTEM user?

Jenkins service was started by windows 'SYSTEM' user and I can not find where is the actual .m2 repository to which artifacts are published from jenkins.
Can be found at:
C:\Windows\System32\config\systemprofile\.m2\

Maven install without internet connection

I am trying to run the cmd maven compile install. I have mentioned my needed dependencies in the pom.xml. I know that it will get the needed jars from the local repository or central repository.
The problem is that I dont have internet connection (no connection to central repository). My question is - can I able to do the same with the system having internet connection and get all the required files in local repository by running maven compile install.
Then by copying the entire local repository (.m2 folder) from the networked system to the system without internet connection will make the maven compile install to succeed ?
or any other solution is there ?
please help me out. Thanks
The best solution is to install a repository manager run the build on one machine all the artifacts will be downloaded into the repository manager and from that time you can build that only with access to the repository manager.
An other solution would be to do as you described on one machine with internet access build your project and copy the local repository onto a second machine and run your build there via mvn -o ....

Can a Jenkins Maven build be executed on separate servers?

Specifically, have the Jenkins instance running on a Linux server execute a Maven build on a Windows server
Yep, you can have a master-slave relation with another box: https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds
If you only want launch a maven build there without setting up a slave, you can install the ssh plugin, configure ssh access on the Windows box, and then remotely execute the maven build

Jenkins CI server and Nexus Server on the same Box

I am in a situation where I have one Build Server box which is to carry out all continuous integration and manage our maven repository. The box works as follows:
There is one maven repository which is hosted through Apache Server as a URL for developers to use
All Jenkins jobs (including release jobs) run mvn install so that artifacts are kept in this one repository.
I would like to get rid of the Apache server and run Nexus on this same box to manage and host repositories, however I have the following questions/ideas:
With Nexus and Jenkins on the same box, will it mean that I will have to manage two repositories, one where maven installs an artifact to a local repository, and one where maven deploys an artifact to nexus? Would it be possible to have Nexus manage the "mvn install" repository also? How can I make sure we don't run out of disk space on the server very very quickly all the time?
Thanks
Added as response to comments: Thank you both, I am thinking I will just set the Jenkins jobs and release plugin goals to mvn package deploy:deploy in order to skip the install phase, that way, artifacts go directly from the target directory to Nexus. However I guess the Jenkins job will require a local repository from which to use depedencies which will get copied from Nexus to the maven local repository during the build, I am not sure if this can be avoided though.
mvn install installs in the local repository
mvn deploy installs to the remote repository
these semantics are defined in the lifecycle and map to different plugins. Their implementations are different.
You don't have to manage the local repository. Actually for some if not most jobs you might even want to define it localized to the job (with the 'Use private Maven repository' option) instead of to the user who is running the job, especially that you plan to use nexus for repository.
You will have to change your jobs to use mvn deploy instead.
How can I make sure we don't run out of disk space on the server very
very quickly all the time?
Configure Jenkins/Nexus. Discard old builds and disable automatic artifact archiving. Both settings can be found in the Jenkins job-configuration. Also you could delete old artifacts automatically from Nexus using Scheduling Tasks.
There is no need to install the artifacts into the local maven repository when using Jenkins/Nexus on a dedicated server.

Resources