Skip to content

Commit

Permalink
fix(aws-cdk): Java init template works on Windows (#1503)
Browse files Browse the repository at this point in the history
  • Loading branch information
costleya authored and rix0rrr committed Jan 15, 2019
1 parent 4e46d3c commit 24f521a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
1 change: 1 addition & 0 deletions packages/aws-cdk/lib/api/cxapp/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export async function execProgram(aws: SDK, config: Settings): Promise<cxapi.Syn
const proc = childProcess.spawn(commandLine[0], commandLine.slice(1), {
stdio: ['ignore', 'inherit', 'inherit'],
detached: false,
shell: true,
env: {
...process.env,
...env
Expand Down
6 changes: 0 additions & 6 deletions packages/aws-cdk/lib/init-templates/app/java/app.sh

This file was deleted.

2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/init-templates/app/java/cdk.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"app": "/bin/bash ./app.sh"
"app": "mvn exec:java"
}
25 changes: 8 additions & 17 deletions packages/aws-cdk/lib/init-templates/app/java/pom.template.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<groupId>com.myorg</groupId>
Expand All @@ -22,23 +23,13 @@
</configuration>
</plugin>

<!-- Emit the classpath to ./.classpath.txt so cdk.json can use it -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>build-classpath</id>
<phase>generate-sources</phase>
<goals>
<goal>build-classpath</goal>
</goals>
<configuration>
<outputFile>.classpath.txt</outputFile>
</configuration>
</execution>
</executions>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<mainClass>com.myorg.HelloApp</mainClass>
</configuration>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 24f521a

Please sign in to comment.