`
dxm1986
  • 浏览: 434968 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

【转】Hudson, Sonar, Maven, Nexus installation wizard,安装指南

 
阅读更多

 

Hudson, Sonar, Maven, Nexus installation wizard
  • Required Software:
  • In order to make all software work smoothly together, we need download the correct version to avoid confliction.






      Nexus
    • Version:  nexus-webapp-1.9.2.war
    • official web site: http://nexus.sonatype.org/
    • Download Page: http://nexus.sonatype.org/downloads/all
    • Note:  We strongly recommend your use war file, as it can be deployed in web server to avoid port confliction. However, you can also download stand alone type nexus-oss-webapp-1.9.2.4-bundle.zip, it will use port 8081.


  • Installation

    • Environment Variable 
      A lot of software needs to setup a environment variable to do some configuration to change the action at runtime. Here are the steps to do this.
    • 1. Press “Winkey + Pause”, and then click the “Advanced system settings” link at left side.
    • 2. Click the “Environment variables” button to the bottom of the “System Properties” Dialog.
    • 3. Click “New” button to create a variable.
    • 4. Input name and value for the fields on the popup dialog. Click OK to apply changes.

    • JDK
    • 1. Click the jdk-6u30-windows-i586.exe, and follow the wizard to setup jdk.
    • 2. Press “Winkey + Pause”, and then click the “Advanced system settings” link at left side.
    • 3. Click the “Environment variables” button to the bottom of the “System Properties” Dialog.
    • 4. Click “New” button to create “JAVA_HOME”, add value “C:\Program Files (x86)\Java\jdk1.6.0_30” for it.
    • 5. Find the variable “path”, and add “%JAVA_HOME%\bin;” before it.
    • 6. Press OK to apply the changes.


      Tomcat
    • 1. Unpack the binary distribution into a convenient location so that the  distribution resides in its own directory (conventionally named  " apache-tomcat-7.0.23"). e.g. C:\apache-tomcat-7.0.23
    • 2. Click the “C:\apache-tomcat-7.0.23\bin\startup.bat” to start the server. You can visit the link http://localhost:8080 if nothing is wrong.


      Maven
    • 1. Unzip the distribution archive, i.e. apache-maven-2.2.1-bin.zip to the directory you wish to install Maven 3.0.3. These instructions assume you chose C:\. The subdirectory apache-maven-2.2.1 will be created from the archive.
    • 2. Add the M2_HOME environment variable by opening up the system properties (WinKey + Pause), selecting the "Advanced" tab, and the "Environment Variables" button, then adding the M2_HOME variable in the user variables with the value C:\ apache-maven-2.2.1. Be sure to omit any quotation marks around the path even if it contains spaces. Note: For Maven < 2.0.9, also be sure that the M2_HOME doesn't have a '\' as last character.
    • 3. In the same dialog, add the M2 environment variable in the user variables with the value %M2_HOME%\bin.
    • 4. Optional: In the same dialog, add the MAVEN_OPTS environment variable in the user variables to specify JVM properties, e.g. the value -Xms256m -Xmx512m. This environment variable can be used to supply extra options to Maven.
    • 5. In the same dialog, update/create the Path environment variable in the user variables and prepend the value %M2% to add Maven available in the command line.
    • 6. In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.
    • 7. Open a new command prompt (Winkey + R then type cmd) and run mvn --version to verify that it is correctly installed.


      Hudson
    • Hudson only needs a Java 5 or newer runtime.
    • Stand alone model:
    • 1. You can simply run the command line: Java  -jar  hudson.war
    • 2. To see Hudson, simply bring up a web browser and go to URL http://myServer:8080 where myServer is the name of the system running Hudson.
    • Deploy Hudson in web container
    • Sometimes, installing the Hudson in web container is a better choice. Hudson also uses the 8080 port. It will cause confliction if you also use tomcat and Hudson seperatelly.
    • 1. Copy hudson.war to C:\apache-tomcat-7.0.23\webapps, and startup the tomcat server by clicking C:\apache-tomcat-7.0.23\bin\startup.bat.
    • 2. To see Hudson, simply bring up a web browser and go to URL http://myServer:8080/hudson,  where myServer is the name of the system running Hudson.
    • Note:  We’d better add this environment variable for tomcat. CATALINA_OPTS=-Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m

    Sonar Plug-in for Huson 
    Copy the sonar.hpi into %HUDSON_HOME%\plugins.  And restart the Tomcat server. Then the sonar plug-in will take effective in Hudson. 
    Sonar
  • 1. Create database
  • Save the following script as create_database.sql, and execute it on mysql command line tool. 
    Sql代码   收藏代码
    1. #  
    2. Create Sonar database and user.  
    3. #  
    4. # Command: mysql -u root -p < create_database.sql  
    5. #  
    6. CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;  
    7. CREATE USER 'sonar' IDENTIFIED BY 'sonar';  
    8. GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';  
    9. GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';  
    10. FLUSH PRIVILEGES;  
  • 2. unzip the distribution to C:\
  • 3. If you do not use the default embedded database, edit conf/sonar.properties to configure the database access. Templates are available for every supported database. Just uncomment the lines you want.
  • Properties代码   收藏代码
    1. sonar.jdbc.url:  jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8  
    2. sonar.jdbc.driverClassName:  com.mysql.jdbc.Driver  
    3. sonar.jdbc.validationQuery:  select 1  
    4. sonar.jdbc.username:    sonar  
    5. sonar.jdbc.password:    sonar  
  • 4. You can run sonar in standalone model by click C:/sonar-2.12/bin/windows-x86-32/ StartSonar.bat, and it will take port 80, you can use it by this link http://localhost:80/sonar.  But we strongly recommend that you deploy it in web container. Let’s see the next step.
  • 5. Add environment variable CATALINA_OPTS with value
  • -Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m
  • 6. Click C:\sonar-2.12\war\build-war.bat to create a war file.  And then copy the sonar.war to C:\apache-tomcat-7.0.23\webapps
  • Note: do NOT remove C:\sonar-2.12 after you deployed war file. The original folder is still useful.
  • Prior to Sonar 2.2, the WAR file must be rebuilt each time the configuration is updated (new plugins or new extensions).
  • From Sonar 2.2 onwards, the WAR file is now linked to the Sonar directory (the directory where the distribution is unzipped). It implies that :
  • •the directory where the distribution is unzipped cannot be removed 
    •there is no need to rebuild the WAR when installing/uninstalling plugins or rule extensions 
    •the WAR file must be deployed on the host which contains the Sonar directory 
    •the WAR file must be rebuilt when the Sonar directory is moved 
    •the WAR file must be rebuilt when a configuration file is updated (directory conf/)
  • 7. Restart the tomcat server.  Access sonar by http://localhost:8080/sonar .

    • Nexus
    • 1. Copy the nexus-webapp-1.9.2.war to C:\apache-tomcat-7.0.23\webapps.
    • 2. Restart the tomcat server.  Access sonar by http://localhost:8080/nexus .
    • Note: We strongly recommend you use JDK 6. Because the nexus  version 1.9.2  and 1.9.2.4 cannot work well with JDK 7 when I write this document.

    Configuration 

      Hudson
    • 1. Hudson needs some disk space to perform builds and keep archives. By default, this is set to windows user folder “ /.hudson”, but you can change this by adding environment variable  “HUDSON_HOME".
    • 2. Open http://localhost:8080/hudson/ , and click “Manage Hudson” at left side, and then click “Configure system” to setup global configurations.
    • Some of the configurations are required; you cannot build successfully if you ignore them. 
      JDK: configure the java_home of java runtime. 
      Maven: specify the maven home path. 
    • 3. If you have installed sonar.hpi, you can see the following segment in the “Configure system” page.
    • set the following fields:
    • Server URL : http://localhost:8080/sonar/
    • Database URL:  jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
    • Database Driver:  com.mysql.jdbc.Driver
    • Database login:    sonar
    • Database password:    sonar
    • 4. At the same page, you can also set value for the “SMTP server”, so that Hudson will send mails to notify you when the build is broken or someone submitted error code to the SVN server.
    • 5. and click “New Job” at left side. Give a name of the project and choice Build a Maven 2/3 project (Legacy), click “OK” button to navigate to next page.
    • 6. At the “Source Code Management” choose the “SVN” option, specify value for “Repository URL”, and you will be asked for username and password later. You’d better specify the full path directly point at the project source folder, so that Hudson can find the pom.xml easily without any further configurations.
    • e.g. svn://svnserver/SEC/projects/Megafon SNAP PoC/source code/trunk/brtconnector
    • 7. If your workspace has the top-level pom.xml in somewhere other than the module root directory, specify the path (relative to the module root) here, such as parent/pom.xml.
    • If left empty, defaults to pom.xml
    • 8. If you have installed sona.phi plug-in, select the checkbox before “Sonar” at the bottom of the page at “Post build Action” section.
    • 9. Click the “Save” button to save all changes.

    Maven 
    Now open the "MAVEN_HOME\conf\setting.xml" and make some changes to make the Nexus take effective in maven. 
    Xml代码   收藏代码
    1.      
    2. <mirror>  
    3.    <id>nexus</id>  
    4.    <mirrorOf>*</mirrorOf>  
    5.    <url>http://localhost:8080/nexus/</url>  
    6. </mirror>  


    And make the following changes to make sonar take effective in maven. 
    Xml代码   收藏代码
    1.         <profile>  
    2.     <id>sonar</id>  
    3.     <activation>  
    4.         <activeByDefault>true</activeByDefault>  
    5.     </activation>  
    6.     <properties>  
    7.         <!-- EXAMPLE FOR MYSQL -->  
    8.         <sonar.jdbc.url>  
    9.                   jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8  
    10.                 </sonar.jdbc.url>  
    11.         <sonar.jdbc.driverClassName>com.mysql.jdbc.Driver</sonar.jdbc.driverClassName>  
    12.         <sonar.jdbc.username>sonar</sonar.jdbc.username>  
    13.         <sonar.jdbc.password>sonar</sonar.jdbc.password>  
    14.         <!-- optional URL to server. Default value is http://localhost:9000 -->  
    15.         <sonar.host.url>  
    16.                   http://localhost:8080/sonar  
    17.                 </sonar.host.url>  
    18.     </properties>  
    19. </profile>  


    Xml代码   收藏代码
    1. <activeProfiles>  
    2.     <activeProfile>sonar</activeProfile>  
    3. </activeProfiles>   
    分享到:
    评论

    相关推荐

      集成工具hudson与maven2的Hudson 安装及配置.docx

      【集成工具Hudson与Maven2的Hudson安装及配置】 持续集成(Continuous Integration, CI)是一种软件开发实践,强调开发人员频繁地将他们的代码更改集成到主分支,以尽早发现并解决潜在的问题。Hudson是一款开源的...

      Linux 安装hudson+maven+nexus

      这个过程主要包括三个主要部分:安装Hudson作为持续集成服务器,配置Maven为项目构建工具,以及安装Nexus作为私有仓库管理器。 首先,安装Hudson。Hudson是一个开源的持续集成工具,它能自动监控和执行项目的构建...

      git-maven-nexus-hudson使用手册

      ### Git、Maven、Nexus与Hudson使用手册解析 #### Git远程仓库的搭建与管理 **Git**作为一款分布式版本控制系统,在软件开发领域扮演着举足轻重的角色。其强大的功能不仅限于版本控制,还支持分支管理、冲突解决等...

      Hudson+Sonar+Maven+SVN详细集成介绍

      Hudson+Sonar+Maven+SVN详细集成介绍

      Hudson+Maven+SVN 自动部署

      【标题】"Hudson+Maven+SVN 自动部署" 在现代软件开发流程中,自动化构建和部署是提升效率和质量的关键环节。Hudson、Maven和SVN(Subversion)是三个重要的工具,它们共同协作可以实现无缝的持续集成和自动部署。 ...

      Windows下 Git+Nexus+Hudson+Maven 整合

      个人整合网上资源加上自己的实践 成功的搭建了一套Git Nexus私服 Hudson管理的环境 并附有Checkout commit deploy 实例

      hudson svn maven 自动构建

      【标题】"Hudson SVN Maven 自动构建"指的是在持续集成环境中使用Hudson(现在称为Jenkins)作为工具,结合Subversion(SVN)作为版本控制系统,Maven作为项目管理和构建工具,实现代码的自动构建过程。这个流程的...

      maven-nexus

      ** Maven Nexus 概述 ** Maven Nexus 是一个企业级的 Maven 仓库管理器,它扩展了 Maven 的本地仓库功能,提供了对 Maven 依赖管理的集中化和优化。Nexus 提供了对 Maven 仓库的全面控制,包括代理远程仓库、存储库...

      hudson和maven完成持续集成

      使用hudson和maven完成持续集成,今天一个朋友过来问我,我就顺便录了一个简短的视屏,对使用做了一个简单的介绍,最大只参上传25M的文件,所以只能分两个包上传,希望能有需要的朋友有帮助

      Hudson+Maven+SVN

      2. **Maven设置**:在Hudson的每个Job配置中,指定Maven的目标,如`clean install`,这将执行清理、编译、测试、打包和安装等阶段。还可以配置Maven的Profile和属性,以适应特定的构建需求。 3. **JDK设置**:为了...

      hudson+maven+svn的简单自动化部署,目前本人已经使用在现网了

      【Hudson + Maven + SVN 简单自动化部署】 在软件开发过程中,自动化部署是提高效率和减少错误的关键环节。本文将详细介绍如何利用Hudson、Maven和SVN实现简单的自动化部署,这种方法已经在实际生产环境中得到了...

      nexus+svn+jenkin_hudson+maven+禅道项目管理软件环境搭建二

      在本篇中,我们将深入探讨如何构建一个完整的IT开发流程,包括使用Nexus作为Maven仓库、Subversion(SVN)作为版本控制系统、Jenkins(Hudson)进行持续集成、Maven作为构建工具,以及禅道(ZenDo)作为项目管理软件...

      nexus+svn+jenkin_hudson+maven+禅道项目管理软件环境搭建一

      本篇将详细讲解如何结合Nexus、SVN、Jenkins(Hudson)、Maven以及禅道这五款工具,搭建一个适用于敏捷开发流程和持续集成理念的环境。这个环境能够极大地提升开发效率,简化项目管理流程。 **Nexus**: Nexus是一款...

      hudson svn maven deploy BOM

      【标题】"hudson svn maven deploy BOM" 涉及到的IT知识点主要集中在持续集成工具Hudson、版本控制系统Subversion(SVN)、构建工具Maven以及部署插件和字符编码处理方面。以下是对这些关键概念的详细解释: 1. **...

      Hudson+Maven+Svn配置[归纳].pdf

      【Hudson+Maven+Svn配置】的整合是软件开发中的一个重要环节,它涉及到了持续集成、自动化构建和版本控制等多个关键领域。以下是对这些工具的详细解释和配置步骤: 1. **Hudson**:Hudson是一个开源的持续集成...

      Hudson+Maven+SVN 快速搭建持续集成环境

      Hudson、Maven和Subversion(SVN)是实现这一目标的三个关键工具。接下来,我们将深入探讨如何使用这些工具快速搭建一个持续集成环境。 **Hudson** Hudson是一个开源的持续集成服务器,用于自动化各种项目构建任务...

      Hudson+Maven+SVN_快速搭建持续集成环境

      Hudson+Maven+SVN_快速搭建持续集成环境.docx

    Global site tag (gtag.js) - Google Analytics