I have a Maven project which depends on a large number of Ant projects, amongst others. I deploy all local jars possible of these dependencies into a single maven repo with this Bash script:
set -e
while IFS= read -r jarPath; do
mvn deploy:deploy-file -Dfile="$file" -DgroupId=${groupId} -DartifactId=$(basename "$jarPath") -Dversion=${version} -Dpackaging=jar -Durl=file:./repo/ -DrepositoryId=repo -DupdateReleaseInfo=true
;done < list.txt
set +e
The script is executed every time these dependencies are rebuilt. The problem is, it takes together minutes of execution time for these effectively tenths of mvn deploy:deploy-file
commands, even if normally there are only few jars or none which require an update.
Can Maven deploy only files with newer file stamps? I cannot see a relevant option in its docs. If there is no such possibility, can the analogous condition be implemented in the script as some Bash condition?
Each jar named ${jarPath}
ends up as ./repo/${groupId with each '.' replaced by '/'}/${file}/${version}/${file}-${version}.jar
where
$file=$(basename "$jarPath")
is a filename with the extension .jar
. It contains only basic ASCII letters, digits, '-' and '.'. No special characters like spaces.
question from:
https://stackoverflow.com/questions/65927920/speed-up-maven-deploy-plugindeploy-file-by-comparing-timestamps 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…