Add Maven to Docker Oracle Linux Image

I spent way too much time figuring out how to install Maven on Oracle Linux from behind a proxy. This is the solution I came up with.

Sample Dockerfile

FROM oraclelinux:6

# Uncomment and update if you are behind a proxy
#RUN export http_proxy=http://user:pass@proxyurl
#RUN export https_proxy=http://user:pass@proxyurl

# Install Maven
RUN yum -y install wget
RUN wget -O /etc/yum.repos.d/epel-apache-maven.repo
RUN yum -y install apache-maven

# Uncomment this in order to connect to maven repos
#ADD settings.xml /root/.m2/settings.xml

Sample Maven settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="" xmlns=""

Maven Publish 2nd Client Jar From Same Repo

I recently need to be able to publish two artifacts from one maven module within a multi module build. I fumbled around for a while looking for the best way to handle this. The key was defining the classifier under configuration.

Maven pom.xml

<?xml version="1.0"?>
<project xmlns=""
        <!-- dependencies -->
        <!-- Define the classes that will make up the client jar -->

Referencing the client jar in another module looks like this.

Dependency Example


JRebel and Maven Resource Filtering

Today, I was having an issue running an ear on a WLS application server. The build for the ear is a multi-module maven build. One of the modules contains a lot of properties files. Several of the property files have configuration information that changes based on environment. For example, a web service endpoint can change between environments.

Maven has is able to do property replacement as part of the packaging process.

# Web Service endpoint

Maven pom.xml


The issue is that JRebel will default to using the properties in src/main/resources that contain the replacement string ${} which will not resolve to a valid url. This will result calls to the web service to fail.

One way to fix this is by excluding the properties files containing replacement strings from being looked at by JRebel. This can be done by editing the jrebel.xml. The syntax for defining the property files to be excluded follows ant style globbing.


<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="" xmlns=""
        <dir name="/configuration/src/main/resources">
              <exclude name=""/>
              <exclude name="**/report_labels*.properties"/>