forked from imixs/imixs-process-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrate_ee8_jakarta9.sh
executable file
·31 lines (25 loc) · 1.2 KB
/
migrate_ee8_jakarta9.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# this script can be used to replace deprecated javax. package names from a
# Java EE8 project with the new jakarta. package names in Jakarta 9
# Initial version from rsoika, 2021
echo "replacing:"
echo " javax.annotation. -> jakarta.annotation."
echo " javax.ejb. -> jakarta.ejb."
echo " javax.enterprise. -> jakarta.enterprise."
echo " javax.faces. -> jakarta.faces."
echo " javax.inject. -> jakarta.inject."
echo " javax.persistence. -> jakarta.persistence."
echo " javax.ws. -> jakarta.ws."
echo "Replacing now..."
###################
## REPLACE LOGIC ##
###################
# replace package names...
find * -name '*.java' | xargs perl -pi -e "s/javax.annotation./jakarta.annotation./g"
find * -name '*.java' | xargs perl -pi -e "s/javax.ejb./jakarta.ejb./g"
find * -name '*.java' | xargs perl -pi -e "s/javax.enterprise./jakarta.enterprise./g"
find * -name '*.java' | xargs perl -pi -e "s/javax.faces./jakarta.faces./g"
find * -name '*.java' | xargs perl -pi -e "s/javax.inject./jakarta.inject./g"
find * -name '*.java' | xargs perl -pi -e "s/javax.persistence./jakarta.persistence./g"
find * -name '*.java' | xargs perl -pi -e "s/javax.ws./jakarta.ws./g"
echo "DONE!"