1 2 3 4 5 6 7 8 9 10 11 | apply plugin: "java" apply plugin: "eclipse" repositories { mavenCentral() } dependencies { compile "org.apache.ivy:ivy:2.3.0" testCompile "junit:junit:4.10" } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import java.util.ArrayList; import java.util.List; import org.apache.ivy.Main; public class Test { public static void main(String[] args) throws Exception { List<String> list = new ArrayList<>(); list.add( "-settings" ); list.add( "ivysettings.xml" ); list.add( "-dependency" ); list.add( "testgroup" ); list.add( "testartifact" ); list.add( "1.0.0" ); list.add( "-retrieve" ); list.add( "lib/[artifact]-[revision].[ext]" ); String[] newArgs = new String[list.size()]; Main.main(list.toArray(newArgs)); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | < ivysettings > < settings defaultResolver = "myResolver" /> < property name = "ivy.checksums" value = "" /> < include url = "${ivy.default.settings.dir}/ivysettings-public.xml" /> < include url = "${ivy.default.settings.dir}/ivysettings-shared.xml" /> < include url = "${ivy.default.settings.dir}/ivysettings-local.xml" /> < include url = "${ivy.default.settings.dir}/ivysettings-main-chain.xml" /> < include url = "${ivy.default.settings.dir}/ivysettings-default-chain.xml" /> < resolvers > < url name = "testivy" > < artifact pattern = "http://myivyserver/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> </ url > < chain name = "myResolver" > < resolver ref = "default" /> < resolver ref = "testivy" /> < resolver ref = "testmaven" /> </ chain > </ resolvers > </ ivysettings > |
No comments:
Post a Comment