File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,13 @@ function print_help() {
32
32
# Function to parse a dependency string and append it to the Maven command
33
33
function add_dependency_to_maven_command() {
34
34
local dep_pair=$1
35
- if [[ ! " ${dep_pair} " =~ .* = .* ]]; then
36
- echo " Malformed dependency string: ${dep_pair} . Expected format: dependency=version "
35
+ if [[ ! " ${dep_pair} " =~ .* :. * : .* ]]; then
36
+ echo " Malformed dependency string: ${dep_pair} . Expected format: {GroupID}:{ArtifactID}:{Version}:{MavenPropertyName} "
37
37
exit 1
38
38
fi
39
- local full_dependency=$( echo " ${dep_pair} " | cut -d' =' -f1 | tr -d ' [:space:]' )
40
- # The dependency can be in the format of {groupId}:{artifactId};{pomPropertyName}
41
- # We only want the pomPropertyName
42
- local dependency=$( echo " ${full_dependency} " | awk -F' ;' ' {print $NF}' )
43
- local version=$( echo " ${dep_pair} " | cut -d' =' -f2 | sed ' s/^[[:space:]]*//;s/[[:space:]]*$//' )
39
+ local full_dependency=$( echo " ${dep_pair} " | rev | cut -d' :' -f2- | rev)
40
+ local dependency=$( echo " ${dep_pair} " | rev | cut -d' :' -f1 | rev)
41
+ local version=$( echo " ${full_dependency} " | awk -F' :' ' {print $NF}' )
44
42
MAVEN_COMMAND+=" -D${dependency} .version=${version} "
45
43
}
46
44
Original file line number Diff line number Diff line change 10
10
" ^library_generation/requirements\\ .txt$"
11
11
],
12
12
"customManagers" : [
13
+ {
14
+ "customType" : " regex" ,
15
+ "fileMatch" : [
16
+ " ^dependencies\\ .txt$"
17
+ ],
18
+ "matchStrings" : [
19
+ " ^(?<depName>[^:]+:[^:]+):(?<currentValue>[^:]+):(?<additionalInfo>[^:]+?)$"
20
+ ],
21
+ "datasourceTemplate" : " maven"
22
+ },
13
23
{
14
24
"customType" : " regex" ,
15
25
"fileMatch" : [
You can’t perform that action at this time.
0 commit comments