Installing a development environment platform on Ubuntu 13.10

It might be useful to have an environment for developing Java application.
For that using Maven (with ANT) and Artifactory might help you to speed up the build & compilation process by helping you to manage all your libraries dependencies.

I will show how to populate the local Oracle Fusion Milddleware 12c libraries  into the Artifactory repository, following : http://docs.oracle.com/middleware/1212/core/MAVEN/config_maven.htm#CDCIBGJA

Just run the following command, to:

    •  Install an Oracle Java platform
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
    • Install Maven
sudo apt-get update && sudo apt-get install maven

Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.11.0-12-generic", arch: "amd64", family: "unix"

    • Install ANT
sudo apt-get update && sudo apt-get install ant

Apache Ant(TM) version 1.9.2 compiled on July 14 2013
    • Install Artifactory : default credentials admin/password
wget http://dl.bintray.com/content/jfrog/artifactory/artifactory-3.0.3.zip

unzip artifactory-2.6.1.zip
sudo mkdir -p /var/lib/artifactory
sudo chown -R tomcat6:tomcat6 /var/lib/artifactory/
unzip artifactory-3.0.3.zip
sudo cp artifactory-3.0.3/webapps/artifactory.war /var/lib/tomcat6/webapps/
sudo vi /etc/default/tomcat6, and append JAVA_OPTS=-Dartifactory.home=/var/lib/artifactory
sudo service tomcat6 restart
    • Install Oracle Maven Synchronization plugin
cd E:\middleware\jdev121200\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.2
mvn install:install-file -DpomFile=oracle-maven-sync.12.1.2.pom -Dfile=oracle-maven-sync.12.1.2.jar
    • Populating a Local Repository
mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=E:\middleware\jdev121200 -Doracle-maven-sync.testingOnly=false

Below a part of my .m2/setting.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<servers>
		<server>
			<username>admin</username>
			<password>password</password>
			<id>central</id>
		</server>
		<server>
			<username>admin</username>
			<password>password</password>
			<id>snapshots</id>
		</server>
		<server>      
			<username>admin</username>
			<password>password</password>
			<id>internal</id>
		</server>
	</servers>
	<profiles>
		<profile>
			<repositories>
				<repository>
					<snapshots>
						<enabled>false</enabled>
					</snapshots>
					<id>central</id>
					<name>libs-release</name>
					<url>http://localhost:8080/artifactory/libs-release</url>
				</repository>
				<repository>
					<snapshots />
					<id>snapshots</id>
					<name>libs-snapshot</name>
					<url>http://localhost:8080/artifactory/libs-snapshot</url>
				</repository>
				<repository>
					<snapshots />
					<id>internal</id>
					<name>libs-snapshot</name>
					<url>http://localhost:8080/artifactory/ext-release-local</url>
				</repository>				
			</repositories>
			<pluginRepositories>
				<pluginRepository>
					<snapshots>
						<enabled>false</enabled>
					</snapshots>
					<id>central</id>
					<name>plugins-release</name>
					<url>http://localhost:8080/artifactory/plugins-release</url>
				</pluginRepository>
				<pluginRepository>
					<snapshots />
					<id>snapshots</id>
					<name>plugins-snapshot</name>
					<url>http://localhost:8080/artifactory/plugins-snapshot</url>
				</pluginRepository>
			</pluginRepositories>
			<id>artifactory</id>
		</profile>

		<profile>
			<id>oracle-maven-121200</id>
			<properties>
				<oracle-maven-sync.serverId>internal</oracle-maven-sync.serverId>
				<oracle-maven-sync.oracleHome>E:\middleware\jdev121200</oracle-maven-sync.oracleHome>
				<oracle-maven-sync.testOnly>false</oracle-maven-sync.testOnly>
				<oracle-maven-sync.failOnError>false</oracle-maven-sync.failOnError>
			</properties>      
		</profile>  

	</profiles>
	<activeProfiles>
		<activeProfile>artifactory</activeProfile>
		<activeProfile>oracle-maven-121200</activeProfile>
	</activeProfiles>
</settings>

Below some screenshot

Screenshot Description
Artifactory_0 Add details here
Artifactory_1 Add details here
Artifactory_2 Add details here

More to come …

Advertisements

About Chenda Mok

19 years of hands on experience in software design and development with emphasis on Enterprise Application Integration (EAI), Services Oriented Architecture (SOA) and Identity Management (IDM) solutions. I’m a software engineer, member of the professional service delivery team working for Salesforce. Prior to this, I worked for Oracle as Solution Architect, through SeeBeyond(06/2005), then SUN’s acquisition (04/2009). After my master’s degree in computer science in 1997; I always delivered consulting on architecture, design, implementation on integration’s field. I’m interested in architecture using EAI/SOA/IDM/BPM/Cloud technologies, software development and Java’s related technologies. I may blog about my work/activities at Salesforce, but I do not speak for my employer, past, present or future.
This entry was posted in Artifactory, Maven and tagged , , , . Bookmark the permalink.