Skip to content

Commit

Permalink
Updated build script to include post processing for the cxf codegen p…
Browse files Browse the repository at this point in the history
…lugin
  • Loading branch information
cameroncaci committed Oct 17, 2023
1 parent 9eb615f commit 4805014
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ echo "Packaging $JAR_NAME..."
# Clean and package via maven
mvn clean package

# Post process cleanup (Required due to the CXF codegen plugin hard coding paths)
./post-process $JAR_NAME

# Announce and calculate checksum
echo "Packaging complete, saving as artifact."
echo "Calculating checksum."
Expand Down
16 changes: 16 additions & 0 deletions scripts/post-process
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

JAR_NAME=$1

UNZIP_DIR="target/unzipped"
mkdir -p $UNZIP_DIR
jar -xf $JAR_NAME -C $UNZIP_DIR

# Modify the specific file
FILE_TO_MODIFY="$UNZIP_DIR/trdm/returntableservice/ReturnTable.java" # This holds the hard coded circleci values from codegen
ORIG_PATH="file:/home/circleci/project/src/main/resources/ReturnTableV7.wsdl" # This is the hard coded circleci value from codegen
NEW_PATH="classpath:ReturnTableV7.wsdl" # Replacing it with classpath
sed -i "s|$ORIG_PATH|$NEW_PATH|g" $FILE_TO_MODIFY # Update the values within the file. (There are 3)

# Re-zip into a JAR
jar -cf $JAR_NAME -C $UNZIP_DIR .

0 comments on commit 4805014

Please sign in to comment.