Closed
Description
It looks like the Java new project template was broken by some recent library changes...
~/Projects/cdk-java-init-test
❯ cdk --version
0.9.0 (build b222731)
~/Projects/cdk-java-init-test
❯ cdk init --language java
Applying project template app for java
Initializing a new git repository...
Executing mvn package...
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.myorg:cdk-java-init-test >--------------------
[INFO] Building cdk-java-init-test 0.1
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/maven-metadata.xml (461 B at 1.3 kB/s)
[INFO]
[INFO] --- maven-dependency-plugin:2.8:build-classpath (build-classpath) @ cdk-java-init-test ---
[INFO] Wrote classpath file '/Users/fulghum/Projects/cdk-java-init-test/.classpath.txt'.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cdk-java-init-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/fulghum/Projects/cdk-java-init-test/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ cdk-java-init-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/fulghum/Projects/cdk-java-init-test/target/classes
[INFO] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java: /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java uses or overrides a deprecated API.
[INFO] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java: Recompile with -Xlint:deprecation for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[20,25] no suitable constructor found for Bucket(com.myorg.HelloConstruct,java.lang.String)
constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
(actual and formal argument lists differ in length)
constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.s3.BucketProps) is not applicable
(actual and formal argument lists differ in length)
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[29,31] method grantRead in class software.amazon.awscdk.services.s3.BucketRef cannot be applied to given types;
required: software.amazon.awscdk.services.iam.IPrincipal,java.lang.Object
found: software.amazon.awscdk.services.iam.IIdentityResource
reason: actual and formal argument lists differ in length
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloStack.java:[34,21] no suitable constructor found for User(com.myorg.HelloStack,java.lang.String)
constructor software.amazon.awscdk.services.iam.User.User(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
(actual and formal argument lists differ in length)
constructor software.amazon.awscdk.services.iam.User.User(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.iam.UserProps) is not applicable
(actual and formal argument lists differ in length)
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.470 s
[INFO] Finished at: 2018-09-13T13:05:23-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project cdk-java-init-test: Compilation failure: Compilation failure:
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[20,25] no suitable constructor found for Bucket(com.myorg.HelloConstruct,java.lang.String)
[ERROR] constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.s3.BucketProps) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[29,31] method grantRead in class software.amazon.awscdk.services.s3.BucketRef cannot be applied to given types;
[ERROR] required: software.amazon.awscdk.services.iam.IPrincipal,java.lang.Object
[ERROR] found: software.amazon.awscdk.services.iam.IIdentityResource
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloStack.java:[34,21] no suitable constructor found for User(com.myorg.HelloStack,java.lang.String)
[ERROR] constructor software.amazon.awscdk.services.iam.User.User(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] constructor software.amazon.awscdk.services.iam.User.User(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.iam.UserProps) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
mvn exited with status 1
~/Projects/cdk-java-init-test master 7s
❯ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.myorg:cdk-java-init-test >--------------------
[INFO] Building cdk-java-init-test 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:build-classpath (build-classpath) @ cdk-java-init-test ---
[INFO] Skipped writing classpath file '/Users/fulghum/Projects/cdk-java-init-test/.classpath.txt'. No changes found.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cdk-java-init-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/fulghum/Projects/cdk-java-init-test/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ cdk-java-init-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/fulghum/Projects/cdk-java-init-test/target/classes
[INFO] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java: /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java uses or overrides a deprecated API.
[INFO] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java: Recompile with -Xlint:deprecation for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[20,25] no suitable constructor found for Bucket(com.myorg.HelloConstruct,java.lang.String)
constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
(actual and formal argument lists differ in length)
constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.s3.BucketProps) is not applicable
(actual and formal argument lists differ in length)
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[29,31] method grantRead in class software.amazon.awscdk.services.s3.BucketRef cannot be applied to given types;
required: software.amazon.awscdk.services.iam.IPrincipal,java.lang.Object
found: software.amazon.awscdk.services.iam.IIdentityResource
reason: actual and formal argument lists differ in length
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloStack.java:[34,21] no suitable constructor found for User(com.myorg.HelloStack,java.lang.String)
constructor software.amazon.awscdk.services.iam.User.User(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
(actual and formal argument lists differ in length)
constructor software.amazon.awscdk.services.iam.User.User(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.iam.UserProps) is not applicable
(actual and formal argument lists differ in length)
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.627 s
[INFO] Finished at: 2018-09-13T13:05:53-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project cdk-java-init-test: Compilation failure: Compilation failure:
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[20,25] no suitable constructor found for Bucket(com.myorg.HelloConstruct,java.lang.String)
[ERROR] constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] constructor software.amazon.awscdk.services.s3.Bucket.Bucket(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.s3.BucketProps) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloConstruct.java:[29,31] method grantRead in class software.amazon.awscdk.services.s3.BucketRef cannot be applied to given types;
[ERROR] required: software.amazon.awscdk.services.iam.IPrincipal,java.lang.Object
[ERROR] found: software.amazon.awscdk.services.iam.IIdentityResource
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] /Users/fulghum/Projects/cdk-java-init-test/src/main/java/com/myorg/HelloStack.java:[34,21] no suitable constructor found for User(com.myorg.HelloStack,java.lang.String)
[ERROR] constructor software.amazon.awscdk.services.iam.User.User(software.amazon.jsii.JsiiObject.InitializationMode) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] constructor software.amazon.awscdk.services.iam.User.User(software.amazon.awscdk.Construct,java.lang.String,software.amazon.awscdk.services.iam.UserProps) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException