Index: doc/standalone.html =================================================================== --- doc/standalone.html (revision 1468204) +++ doc/standalone.html (working copy) @@ -45,10 +45,15 @@ use this instead of ivy file to do the rest of the work with this as a dependency. -confs resolve given configurations + -types comma separated list of accepted artifact types + -mode the resolve mode to use + -notransitive do not resolve dependencies transitively ==== retrieve options -retrieve use given pattern as retrieve pattern + -ivypattern use given pattern to copy the ivy files -sync use sync mode for retrieve + -symlink create symbolic links ==== cache path options -cachepath outputs a classpath consisting of all dependencies @@ -60,9 +65,10 @@ ==== publish options -publish use given resolver to publish to - -publishpattern use given pattern to find artifacts to publish + -publishpatterns list of patterns to find artifacts to publish -revision use given revision to publish the module -status use given status to publish the module + -overwrite overwrite files in the repository if they exist ==== http auth options -realm use given realm for HTTP AUTH @@ -84,6 +90,7 @@ ==== help options -? display this help -deprecated show deprecated options + -version displays version information since 1.3 System properties are included as ivy variables, so you can easily define an ivy variable like this: Index: src/java/org/apache/ivy/Main.java =================================================================== --- src/java/org/apache/ivy/Main.java (revision 1468204) +++ src/java/org/apache/ivy/Main.java (working copy) @@ -127,8 +127,10 @@ .addCategory("publish options") .addOption(new OptionBuilder("publish").arg("resolvername") .description("use given resolver to publish to").create()) - .addOption(new OptionBuilder("publishpattern").arg("artpattern") - .description("use given pattern to find artifacts to publish").create()) + .addOption(new OptionBuilder("publishpatterns").arg("artpatterns").countArgs(false) + .description("list of patterns to find artifacts to publish").create()) + .addOption(new OptionBuilder("publishpattern").arg("artpattern").countArgs(false).deprecated() + .description("pattern to find artifacts to publish").create()) .addOption(new OptionBuilder("revision").arg("revision") .description("use given revision to publish the module").create()) .addOption(new OptionBuilder("status").arg("status") @@ -302,9 +304,8 @@ .setStatus(settings.substitute(line.getOptionValue("status", "release"))) .setValidate(validate)); if (line.hasOption("publish")) { - ivy.publish(md.getResolvedModuleRevisionId(), Collections.singleton(settings - .substitute(line.getOptionValue("publishpattern", - "distrib/[type]s/[artifact]-[revision].[ext]"))), line + List publishPatterns = getPublishPatterns(line, settings); + ivy.publish(md.getResolvedModuleRevisionId(), publishPatterns, line .getOptionValue("publish"), new PublishOptions() .setPubrevision(settings.substitute(line.getOptionValue("revision"))) .setValidate(validate).setSrcIvyPattern( @@ -369,6 +370,31 @@ } return fileList; } + + /** + * Parses the publishpattern option from the command line, and returns a list of patterns as String. + * + * @param line + * the command line in which the publishpattern option should be parsed + * @param settings + * the IvySettings object for this invocation + * @return a List of publish patterns as String. If no pattern is provided, a singleton with the default value. + */ + private static List/**/ getPublishPatterns(CommandLine line, IvySettings settings) { + String[] publishPatternsString; + if (line.hasOption("publishpatterns")) { + publishPatternsString = line.getOptionValues("publishpatterns"); + } else if(line.hasOption("publishpattern")) { + publishPatternsString = line.getOptionValues("publishpattern"); + } else { + publishPatternsString = new String[] {"distrib/[type]s/[artifact]-[revision].[ext]"}; + } + List publishPatterns = new ArrayList(publishPatternsString.length); + for (int i = 0; i < publishPatternsString.length; i++) { + publishPatterns.add(settings.substitute(publishPatternsString[i])); + } + return publishPatterns; + } private static IvySettings initSettings(CommandLine line, Ivy ivy) throws java.text.ParseException, IOException, ParseException {