Skip to content
This repository has been archived by the owner on Dec 4, 2017. It is now read-only.

Commit

Permalink
Modify the settings.xml file if there is a
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoulliard committed Jan 18, 2017
1 parent 7e821eb commit cb55ba0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,24 @@ else
REPO=http://repository.jboss.org/nexus/content/repositories/public
fi

if [ -f "${S2I_SOURCE_DIR}/configuration/settings.xml" ]; then
if [ -n "$MAVEN_MIRROR_URL" ]; then
xml="<repository>\
<id>mirror-maven</id>\
<url>$MAVEN_MIRROR_URL</url>\
</repository>"
sed -i "s|<!-- ### repository ### -->|$xml|" ${S2I_SOURCE_DIR}/configuration/settings.xml

xml="<pluginRepository>\
<id>mirror-plugin-maven</id>\
<url>$MAVEN_MIRROR_URL</url>\
</pluginRepository>"
sed -i "s|<!-- ### pluginrepository ### -->|$xml|" ${S2I_SOURCE_DIR}/configuration/settings.xml
fi
fi

echo "Settings.xml file : ${S2I_SOURCE_DIR}/configuration/settings.xml"

echo "URL of the WildFly Swarm Uber jar : $REPO/org/obsidiantoaster/generator-backend/$APP_VERSION/generator-backend-$APP_VERSION-swarm.jar"

curl -o /deployments/generator-swarm.jar -L $REPO/org/obsidiantoaster/generator-backend/$APP_VERSION/generator-backend-$APP_VERSION-swarm.jar
2 changes: 2 additions & 0 deletions configuration/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<profile>
<id>repositories</id>
<repositories>
<!-- ### repository ### -->
<repository>
<id>Maven Central</id>
<url>http://repo1.maven.org/maven2/</url>
Expand Down Expand Up @@ -46,6 +47,7 @@
</repository>
</repositories>
<pluginRepositories>
<!-- ### pluginrepository ### -->
<pluginRepository>
<id>Maven Central</id>
<url>http://repo1.maven.org/maven2/</url>
Expand Down

0 comments on commit cb55ba0

Please sign in to comment.