diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java index 2ec0f62679..90f61c7082 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java @@ -97,7 +97,7 @@ public class CLIManager public static final String THREADS = "T"; - private Options options; + protected Options options; @SuppressWarnings( "static-access" ) public CLIManager() @@ -262,5 +262,4 @@ public void displayHelp( PrintStream stdout ) pw.flush(); } - } diff --git a/maven-embedder/src/site/apt/index.apt.vm b/maven-embedder/src/site/apt/index.apt.vm new file mode 100644 index 0000000000..56d4fe59a1 --- /dev/null +++ b/maven-embedder/src/site/apt/index.apt.vm @@ -0,0 +1,15 @@ + ----- + ${project.name} + ----- + Hervé Boutemy + ----- + 2012-04-29 + ----- + +${project.name} + + ${project.description} + +Supported CLI Options + +%{snippet|file=${project.basedir}/target/test-classes/options.apt|verbatim=false} diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java new file mode 100644 index 0000000000..0de6cf6ad0 --- /dev/null +++ b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java @@ -0,0 +1,98 @@ +package org.apache.maven.cli; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.commons.cli.Option; +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.util.FileUtils; + +public class CLIManagerTest + extends PlexusTestCase +{ + private final static String LS = System.getProperty( "line.separator" ); + + private static class OptionComparator + implements Comparator