Skip to content

Commit 24f521a

Browse files
costleyarix0rrr
authored andcommitted
fix(aws-cdk): Java init template works on Windows (#1503)
1 parent 4e46d3c commit 24f521a

File tree

4 files changed

+10
-24
lines changed

4 files changed

+10
-24
lines changed

packages/aws-cdk/lib/api/cxapp/exec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export async function execProgram(aws: SDK, config: Settings): Promise<cxapi.Syn
7878
const proc = childProcess.spawn(commandLine[0], commandLine.slice(1), {
7979
stdio: ['ignore', 'inherit', 'inherit'],
8080
detached: false,
81+
shell: true,
8182
env: {
8283
...process.env,
8384
...env

packages/aws-cdk/lib/init-templates/app/java/app.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"app": "/bin/bash ./app.sh"
2+
"app": "mvn exec:java"
33
}

packages/aws-cdk/lib/init-templates/app/java/pom.template.xml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<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">
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
3+
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
34
<modelVersion>4.0.0</modelVersion>
45

56
<groupId>com.myorg</groupId>
@@ -22,23 +23,13 @@
2223
</configuration>
2324
</plugin>
2425

25-
<!-- Emit the classpath to ./.classpath.txt so cdk.json can use it -->
2626
<plugin>
27-
<groupId>org.apache.maven.plugins</groupId>
28-
<artifactId>maven-dependency-plugin</artifactId>
29-
<version>2.8</version>
30-
<executions>
31-
<execution>
32-
<id>build-classpath</id>
33-
<phase>generate-sources</phase>
34-
<goals>
35-
<goal>build-classpath</goal>
36-
</goals>
37-
<configuration>
38-
<outputFile>.classpath.txt</outputFile>
39-
</configuration>
40-
</execution>
41-
</executions>
27+
<groupId>org.codehaus.mojo</groupId>
28+
<artifactId>exec-maven-plugin</artifactId>
29+
<version>1.6.0</version>
30+
<configuration>
31+
<mainClass>com.myorg.HelloApp</mainClass>
32+
</configuration>
4233
</plugin>
4334
</plugins>
4435
</build>

0 commit comments

Comments
 (0)