Last active
December 16, 2015 05:59
-
-
Save ebridges/5388570 to your computer and use it in GitHub Desktop.
Load a bunch of dependencies from a source repo into a local folder to make a POM portable.
This file contains 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
#!/usr/bin/perl | |
use strict; | |
my $repo="$ENV{HOME}/.m2/repository"; | |
my $cwd = `pwd`; | |
chomp($cwd); | |
my $localRepo=$cwd.'/lib'; | |
for(<DATA>) { | |
chomp; | |
my($g,$a,$t,$v) = split /,/; | |
my $p = $g; | |
$p =~ s/\./\//g; | |
print qq{ | |
mvn install:install-file \\ | |
-DgroupId=$g \\ | |
-DartifactId=$a \\ | |
-Dversion=$v \\ | |
-Dpackaging=$t \\ | |
-Dfile=$repo/$p/$a/$v/$a-$v.$t \\ | |
-DlocalRepositoryPath=$localRepo \\ | |
-DcreateChecksum=true \\ | |
-DgeneratePom=true | |
} | |
} | |
__DATA__ | |
com.example.android,android-internal,apklib,1.0-SNAPSHOT | |
com.example.android,android-common,apklib,1.0-SNAPSHOT | |
etc | |
etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment