- 1 Installation and configuration of central server infrastructure
- 2 JAVA
- 3 Nexus
- 4 Sonar
- 5 Maven
- 6 Hudson
- 7 Selenium Server (Selenium Remote Control)
- 8 Tomcat
Installation and configuration of central server infrastructure
It is recommended to install the tools in the proposed sequence, since we have the following dependencies:
- Hudson uses Maven
- Hudson includes the Sonar plugin and triggers Sonar
- Maven retrieves libraries from Nexus
- Hudson executes the Maven script
- Maven includes profiles from Sonar and Nexus.
We assume that SVN is already installed and that the projects exist in SVN.
- Download and install java.
- Set environment setting JAVA_HOME pointing to the java folder (e.g. on Windows “C:\Program Files\Java\jdk1.6.0_21\bin”).
Initial Installation and configuration (one time)
Download file (OS dependent) from http:////nexus.sonatype.org/downloads (e.g. “nexus-oss-webapp-1.8.0-bundle.zip”). Extract files to final directory. OS dependent
- Windows: Open command line with bin folder as current directory (e.g. “C:\nexus\nexus-oss-webapp-1.8.0\bin\jsw\windows-x86-32”). Run Installnexus and Startnexus from command line. Windows Users (Vista, Windows 7) need to execute cmd.exe as Administrator (go to “All Programs”, “Accessories”, “Command Prompt”, right mouse click on “Run as Administrator”.
- Linux: Create folder /var/nexus/. Copy downloaded filder into this folder. Open command line with bin folder as current (e.g. /var/nexus/nexus-oss-webapp-1.8.0/bin/jsw/linux-x86-32). Run sudo ./nexus start
Alternatively you can install Nexus as service as described in http://www.sonatype.com/books/nexus-book/reference/ch03s06.html.
Test Nexus: http://localhost:8081/nexus/index.html. Login to Nexus with user name and password “admin” respectively “admin123”. Optionally make SMTP settings.
How to change the password
If the NEXUS password is changed (TODO: has to be done soon), this has to happen in two places: 1. Change it in Nexus itself using the administration/security interface 2. Change it in the settings.xml in maven/conf/ directory.
TODO: Change password.
Setting up repositories
Option 1: Upload files individually
Nexus comes with a predefined set of repositories. Now add the artifacts as described in the project manager's guide. TODO add link.
Option 2: Optionally import external repositories
After install there is a “storage” folder (e.g. “C:\nexus\sonatype-work\nexus\storage”).
Copy Sonar folder to storage and overwrite folder “thirdparty”. In thirdparty there are the Stanford libs. Please refer to the appendix to get an overview.
Current problem: the jars in the official repositories have not distinct versions. So it is not possible to point to a specific version. We are talking about the jars mentioned in the WebProtege developer guide (http://protegewiki.stanford.edu/wiki/WebProtegeDevelopersGuide) section “Fix project compilation errors”.
Just download zip file sonar-2.2 from http://www.sonarsource.org/. Unpack it to our tools folder (e.g. to /var/sonar/sonar-2.2).
Start sonar from bin folder (e.g. /var/sonar/sonar-2.2/bin/linux-x86-32 folder:
- Windows StartSonar
- Linux: sonar.sh (don’t forget to make this file and wrapper to be executable (set permissions)
Test Sonar via http://localhost:9000. The default admin user name and password are admin/admin, however, there is no need to login.
Optionally install Sonar as LINUX service. Command line /var/sonar/sonar-2.2.3/sudo cp bin/linux-x86-64/sonar.sh /etc/init.d/sonar
Download Maven from http://maven.apache.org/download.html und chose apache-maven-2.2.1.
Add system environment variables:
- M2_HOME pointing to new directory apache-maven-2.2.1
- JAVA_HOME (if not already set)
Add to Path ;%M2_HOME%\bin
Change file “apache-maven-2.2.1/conf/settings.xml”
- Add mirror (http://localhost:8081/nexus/content/groups/public)
<mirrors> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8081/nexus/content/groups/public</url> </mirror> </mirrors>
- Add profiles for sonar and nexus
<profiles> <profile> <id>nexus</id> <repositories> <repository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginRepository> </pluginRepositories> </profile> <profile> <id>sonar</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> </properties> </profile> </profiles> <activeProfiles> <activeProfile>nexus</activeProfile> </activeProfiles>
- Add servers
<servers> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> </servers>
A complete settings.xml file can be downloaded from here. TODO
Install (one time) and start Hudson
- Download war-file from www.hudson-ci.org. Just click on “latest and greatest”.
- Start server with java –jar hudson.war. Runs on http://localhost:8080
- Follow steps as described in http://hudson-ci.org/redhat/ (to use YUM) which are
- sudo rpm --import http://hudson-ci.org/redhat/hudson-ci.org.key
- wget -O /tmp/hudson.rpm http://hudson-ci.org/latest/redhat/hudson.rpm
- sudo rpm --install /tmp/hudson.rpm
- Start: sudo /etc/rc.d/init.d/hudson start
Initial Configuration (one time)
- Go to “Manage Hudson” → “Manage Plugins”.
- Go to available plugins and install “Hudson Sonar Plugin”.
- Optionally add additional plugins. E.g. for Twitter, Trigger, e.g. jabber. Build reports is not needed as we use Sonar.
Go back to “Manage Hudson” and select “Configure System” and make the following changes/settings
- Jdk: set name (e.g. “Java 1.6”) and path to Java (e.g. “C:\Program Files\Java\jdk1.6.0_21”). Hudson does not read the system variable JAVA_HOME.
- Maven: Add Maven (not ANT) and set name (e.g. “Maven 2”) and path to Maven (e.g. “C:\Tools\apache-maven-2.2.1” respectively ). Hudson does not read the system variable MAVEN_HOME.
- “Add Sonar”. Just add a name (e.g. “Sonar”). Set location e.g. to http://bmir-hudson1:9000.
- Optionally set e-mail notifications
Please refer to the project manager section. TODO add link.
Go to Hudson > Manage Server > Configure System and add an user by entering a name in text field "User/group to add". Ignore the warning symbol, it will disappear as soon the user has registered himself. Give user rights by checking checkboxes. Click save.
Selenium Server (Selenium Remote Control)
Set up a central Selenium Server.
- Download Selenium RC from http://seleniumhq.org/download/.
- Unzip file. We only need selenium-server-1.0.3 subfolder.
- Start server with java –jar selenium-server.jar
- Make sure that the display is set, e.g. export DISPLAY=… (case sensitive, only WLAN IP worked?!?)
There is already a file /etc/init.d/start-selenium-server.sh.
[johner@bmir-hudson1 ~]$ export DISPLAY=10.39.35.249:0.0 [johner@bmir-hudson1 ~]$ xhost access control disabled, clients can connect from any host INET:DN0a2723f9.SUNet LOCAL: INET:bmir-hudson1.stanford.edu [johner@bmir-hudson1 ~]$ java -jar /var/selenium/selenium-server.jar
Note: the display settings have to be done before selenium is started!
Either there is a XServer running on the test machine or a client machine (or server itself) needs running X-Server, e.g. run xming –ac. XMing is available for Windows.
Standard out of the box: Either use yum or just download and extract apache-tomcat. Change in server-xml port to 8082 in order to avoid conflicts with Hudson.
User name and password currently are currently set to admin/protégé.
Change by Alex: /usr/local/tomcat6 it should start with /sbin/service tomact6 start