Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ant target and shell scripts to repackage the war
- Loading branch information
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/.metadata/ | ||
/x-*/ | ||
*.txt | ||
*.bat | ||
/*.bat | ||
*.zip | ||
/.recommenders/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@echo off | ||
|
||
::-------------------------------------------------------------------------------- | ||
:: Repackage a war file by adding specified jars in its WEB-INF/lib directory | ||
:: | ||
:: Parameters: | ||
:: - %1 is the path to the war file to repackage | ||
:: example: build/jppf-admin-web-6.0.war | ||
:: - all subsequent parameters specify the path to one or more jars to add | ||
:: Wildcards * and ? are allowed | ||
:: example: C:\jppf\lib\mylib.jar C:\jppf\lib2\*.jar | ||
:: | ||
:: Full example usage: | ||
:: repackage build\jppf-admin-web-6.0.war C:\jppf\lib\mylib.jar C:\jppf\lib2\*.jar | ||
::-------------------------------------------------------------------------------- | ||
|
||
set current_dir=%~dp0 | ||
|
||
|
||
rmdir /S /Q %current_dir%tmp > nul | ||
mkdir %current_dir%\tmp\WEB-INF\lib | ||
|
||
echo copying jar files to %current_dir%tmp\WEB-INF\lib | ||
|
||
for %%x in (%*) do ( | ||
if NOT "%1"=="%%x" ( | ||
for %%g in (%%x) do ( | ||
copy %%g %current_dir%tmp\WEB-INF\lib > nul | ||
) | ||
) | ||
) | ||
|
||
echo updating %1 | ||
|
||
call jar uf %1 -C %current_dir%tmp . | ||
|
||
rmdir /S /Q %current_dir%tmp > nul | ||
|
||
echo done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#! /bin/sh | ||
|
||
#----------------------------------------------------------------------------------- | ||
# Repackage a war file by adding specified jars in its WEB-INF/lib directory | ||
# | ||
# Parameters: | ||
# - $1 is the path to the war file to repackage | ||
# example: build/jppf-admin-web-6.0.war | ||
# - all subsequent parameters specify the path to one or more jars to add | ||
# Wildcards * and ? are allowed | ||
# example: ~/jppf/lib/mylib.jar ~/jppf/lib2/*.jar | ||
# | ||
# Full example usage: | ||
# ./repackage.sh build/jppf-admin-web-6.0.war ~/jppf/lib/mylib.jar ~/jppf/lib2/*.jar | ||
#----------------------------------------------------------------------------------- | ||
|
||
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
rm -rf "$current_dir" | ||
mkdir -p "$current_dir"/tmp/WEB-INF/lib | ||
|
||
echo copying jar files to $current_dir/tmp/WEB-INF/lib | ||
|
||
for p in $*; do | ||
if "$p" != $1 | ||
cp $p "$current_dir"/tmp/WEB-INF/lib | ||
fi | ||
done | ||
|
||
echo updating $1 | ||
|
||
jar uf $1 -C $current_dir/tmp . | ||
|
||
rm -rf $current_dir |