CD part II: Setup the environment(maven/git/java/netbeans)

Johan Tuitel

  • 18/11/2016
  • 4 minuten leestijd
Johan Tuitel

CD part II: Setup the environment(maven/git/java/netbeans)

In this part i have described the setup of maven, git, java and netbeans! If you are familiar whit this, skip to the next blog!

tools used

these tools i have used to create the continuous delivery pipeline and will be described in the next blogposts!

  1. java 1.8
  2. maven 3.4
  3. git 2.7.4
  4. netbeans 8.1
  5. tomcat 7.0.68
  6. postgresql 9.5.1-1
  7. nexus-2.12.1-01
  8. jenkins 1.651.1
  9. SonarQube 5.4
  10. Bitbucket
  11. jaxws 2.2.10

java installation

  1. first we need to download the 1.8 jdk
  2. go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  3. get the latest jdk(jdk-8u77-windows-x64.exe)
  4. probably this file is set in the download folder
  5. we are going to create a tools folder on the c:\ disk
  6. in this folder we put the downloaded exe file

setup java

  1. we now have the exe file in the c:\tools folder
  2. double click on the file to install java
  3. change the install to into c:\tools\Java\jdk1.8.0_77
  4. click on next and do a default installation
  5. next we get a popup to install the jre
  6. change the install to into c:\tools\Java\jre1.8.0_77
  7. click on next and finallize the installations

java configuration

  1. open Configurationscreen > System > Advanced System Settings > Environment Variables
  2. create a variable under the Systemvariables called JAVA_HOME
  3. name: JAVA_HOME
  4. value: C:\tools\Java\jdk1.8.0_77
  5. new we have to adjust the path variable
  6. add %JAVA_HOME%\bin; in the beginning of the variable value

java check

  1. new we check if the installation is done correctly
  2. open command-prompt
  3. go to c:\
  4. enter java -version

maven installation

  1. second we are going to download maven
  2. go to https://maven.apache.org/download.cgi
  3. download the Binary zip archive(apache-maven-3.3.9-bin.zip)
  4. put this zip file in the c:\tools folder
  5. unzip the file with winzip/winrar
  6. probably you have a dir-structure like this: c:\tools\apache-maven-3.3.9-bin\apache-maven-3.3.9
  7. we are going to move the apache-maven-3.3.9 under c:\tools
  8. delete the apache-maven-3.3.9-bin folder because it is obsolete

maven installation

maven configuration

  1. open Configurationscreen > System > Advanced System Settings > Environment Variables
  2. create a variable under the Systemvariables called M2_HOME
  3. name: M2_HOME
  4. value: C:\tools\apache-maven-3.3.9
  5. new we have to adjust the path variable
  6. add %M2_HOME%\bin; in the beginning of the variable value

maven check

  1. new we check if the installation is done correctly
  2. open command-prompt
  3. go to c:
  4. enter mvn -v

maven version

set local repository

  1. navigate to C:\tools\apache-maven-3.3.9\conf
  2. search for localRepository
  3. add a new line under the comment: c:\repository

configure the Develop and Test server

we are going to create 4 servers

  1. WebServiceDevelop to develop our services(development)
  2. WebServiceTest to test our services(test)
  3. WebAppDevelop to develop our application(development)
  4. WebAppTest to test our application(test)
  5. op the settings.xml in the folder c:\tools\apache-maven-3.3.9\conf
  6. navigate to the server section and add
    <server>
        <id>WebServiceDevelop</id>
        <username>johan</username>
        <password>troposphere</password>
    </server>
    <server>
        <id>WebServiceTest</id>
        <username>david</username>
        <password>oriental</password>
    </server>
    <server>
        <id>WebAppDevelop</id>
        <username>max</username>
        <password>voyager</password>
    </server>
    <server>
        <id>WebAppTest</id>
        <username>elliot</username>
        <password>feedom</password>
    </server>

git installation

  1. thirdly we are going to download git
  2. go to https://git-scm.com/downloads
  3. click on the button 'Download for Windows'
  4. click on the link: 64-bit Git for Windows Setup.
  5. double click on the Git-2.7.4-64-bit.exe file
  6. install git in the folder C:\tools\Git-2.7.4
  7. click next until you can choose Ajusting your PATH environment
  8. choose the second radiobutton: Use Git from the windows command prompt
  9. click next > next
  10. you can choose configuring the terminal emulator to use Git Bash
  11. choose the second radiobutton: Use windows' default console window
  12. finish the installation

git configuration

  1. open Configurationscreen > System > Advanced System Settings > Environment Variables
  2. create a variable under the Systemvariables called GIT_HOME
  3. name: GIT_HOME
  4. value: C:\tools\Git-2.7.4
  5. new we have to adjust the path variable
  6. add %GIT_HOME%\bin; in the beginning of the variable value

git check

  1. new we check if the installation is done correctly
  2. open command-prompt
  3. go to c:
  4. enter git --version

git version

netbeans installation

  1. at last we are going to download netbeans(other java-IDE's are just fine, but i use netbeans because the maven integration is great)
  2. go to https://netbeans.org/downloads/
  3. download the Java SE version
  4. double click on the netbeans-8.1-javase-windows.exe file
  5. for the installation choose the next settings
  6. install the Netbeans IDE to: C:\tools\NetBeans 8.1
  7. JDK for the Netbeans IDE to: C:\tools\Java\jdk1.8.0_77
  8. finish the installation by choosing the default settings