Skip to content

Commit

Permalink
Replace classpath argument with environment variable
Browse files Browse the repository at this point in the history
If the project has a lot of dependencies compiling widgetset
on Windows fails due to too long command line; to reduce
command line lenght classpath is given as
CLASSPATH environment variable.
  • Loading branch information
mcollovati authored and hesara committed Mar 9, 2017
1 parent 549fae6 commit 28e7534
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/codehaus/mojo/gwt/shell/JavaCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,15 @@ public void execute()
{
command.addAll( this.jvmArgs );
}
command.add( "-classpath" );

List<String> path = new ArrayList<String>( classpath.size() );
for ( File file : classpath )
{
path.add( file.getAbsolutePath() );
}
command.add( StringUtils.join( path.iterator(), File.pathSeparator ) );
environment("CLASSPATH", StringUtils.join( path.iterator(), File.pathSeparator ));


if ( systemProperties != null )
{
for ( Map.Entry<?, ?> entry : systemProperties.entrySet() )
Expand Down Expand Up @@ -311,6 +313,7 @@ public void execute()
cmd.addEnvironment( (String) entry.getKey(), (String) entry.getValue() );
}
}

log.debug( "Execute command :\n" + cmd.toString() );
int status;
if ( timeOut > 0 )
Expand Down

0 comments on commit 28e7534

Please # to comment.