Skip to content

Commit

Permalink
Merge pull request #1 from CodinGame/project_init
Browse files Browse the repository at this point in the history
feat: add all the files to build the project
  • Loading branch information
aca-cg authored Jan 18, 2017
2 parents 3c51cab + d61d68b commit c559a02
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM openjdk:8-jdk

MAINTAINER CodinGame <[email protected]>

ARG MAVEN_VERSION=3.3.9
ARG USER_HOME_DIR="/root"

# Install maven
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \
| tar -xzC /usr/share/maven --strip-components=1 \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"

COPY settings.xml $USER_HOME_DIR/.m2/

COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# maven3-builder
The maven3 builder
This is the maven3 builder.
It aims at building the project, that is:
- create all the jar files
- copy the jar files into the target directory
- copy all the dependencies into the target directory
13 changes: 13 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

SRC_DIR=${1:-/project/source}
TARGET_DIR=${2:-/project/target}

cd ${SRC_DIR}

# Build the project: create all the jar files
mvn clean install jar:test-jar -DskipTests
# Copy the jar files into the target directory
find . -name "*.jar" -exec cp {} ${TARGET_DIR} \;
# Copy all the dependencies into the target directory
mvn dependency:copy-dependencies -DoutputDirectory=${TARGET_DIR}
10 changes: 10 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>central</mirrorOf>
<url>https://nexus.codingame.com/repository/maven-central/</url>
</mirror>
</mirrors>
</settings>

0 comments on commit c559a02

Please sign in to comment.