File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,15 +32,13 @@ function print_help() {
3232# Function to parse a dependency string and append it to the Maven command
3333function add_dependency_to_maven_command() {
3434 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} "
3737 exit 1
3838 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}' )
4442 MAVEN_COMMAND+=" -D${dependency} .version=${version} "
4543}
4644
Original file line number Diff line number Diff line change 1010 " ^library_generation/requirements\\ .txt$"
1111 ],
1212 "customManagers" : [
13+ {
14+ "customType" : " regex" ,
15+ "fileMatch" : [
16+ " ^dependencies\\ .txt$"
17+ ],
18+ "matchStrings" : [
19+ " ^(?<depName>[^:]+:[^:]+):(?<currentValue>[^:]+):(?<additionalInfo>[^:]+?)$"
20+ ],
21+ "datasourceTemplate" : " maven"
22+ },
1323 {
1424 "customType" : " regex" ,
1525 "fileMatch" : [
You can’t perform that action at this time.
0 commit comments