Skip to content

Instantly share code, notes, and snippets.

@ebridges
Last active December 16, 2015 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebridges/5388570 to your computer and use it in GitHub Desktop.
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.
#!/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