mirror of https://github.com/apache/maven.git
[MNG-5338] Accept a directory with -f/--file
Submitted by Jesse Glick. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1382080 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e901c5797
commit
541bc917e8
|
@ -104,7 +104,7 @@ public class CLIManager
|
|||
{
|
||||
options = new Options();
|
||||
options.addOption( OptionBuilder.withLongOpt( "help" ).withDescription( "Display help information" ).create( HELP ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "file" ).hasArg().withDescription( "Force the use of an alternate POM file." ).create( ALTERNATE_POM_FILE ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "file" ).hasArg().withDescription( "Force the use of an alternate POM file (or directory with pom.xml)." ).create( ALTERNATE_POM_FILE ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "define" ).hasArg().withDescription( "Define a system property" ).create( SET_SYSTEM_PROPERTY ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "offline" ).withDescription( "Work offline" ).create( OFFLINE ) );
|
||||
options.addOption( OptionBuilder.withLongOpt( "version" ).withDescription( "Display version information" ).create( VERSION ) );
|
||||
|
|
|
@ -954,6 +954,10 @@ public class MavenCli
|
|||
if ( alternatePomFile != null )
|
||||
{
|
||||
File pom = resolveFile( new File( alternatePomFile ), workingDirectory );
|
||||
if ( pom.isDirectory() )
|
||||
{
|
||||
pom = new File( pom, "pom.xml" );
|
||||
}
|
||||
|
||||
request.setPom( pom );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue