Created
November 27, 2019 17:37
-
-
Save leobessa/45841dfd634e72d5b181a33520d461c2 to your computer and use it in GitHub Desktop.
Script for mvn install:install-file for jars in directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir["./**/*.jar"].map do |f| | |
group_dir, artifact_id, version, file_name = f.reverse.split("/", 4).map(&:reverse).reverse | |
path = File.absolute_path f | |
group_id = group_dir.sub("./","").gsub("/",".") | |
packaging = "jar" | |
pom_path = path.sub /\.[^.]+\z/, ".pom" | |
"mvn install:install-file -Dfile=#{path} -DgroupId=#{group_id} -DartifactId=#{artifact_id} -Dversion=#{version} -Dpackaging=#{packaging} -DpomFile=#{pom_path} -DcreateChecksum=true" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment