diff --git a/pkg/cmd/pulumi-language-java/language_test.go b/pkg/cmd/pulumi-language-java/language_test.go
index a13a41383d7..f7baa21d0ae 100644
--- a/pkg/cmd/pulumi-language-java/language_test.go
+++ b/pkg/cmd/pulumi-language-java/language_test.go
@@ -178,8 +178,6 @@ var expectedFailures = map[string]string{
"l2-invoke-variants": "unimplemented for Java",
"l2-large-string": "unimplemented for Java",
"l2-map-keys": "unimplemented for Java",
- "l2-plain": "unimplemented for Java",
- "l2-primitive-ref": "unimplemented for Java",
"l2-provider-grpc-config-schema-secret": "unimplemented for Java",
"l2-provider-grpc-config-secret": "unimplemented for Java",
"l2-provider-grpc-config": "unimplemented for Java",
diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/Pulumi.yaml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/Pulumi.yaml
new file mode 100644
index 00000000000..088b5c9728b
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/Pulumi.yaml
@@ -0,0 +1,2 @@
+name: l2-plain
+runtime: java
diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/pom.xml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/pom.xml
new file mode 100644
index 00000000000..fde23a1817d
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/pom.xml
@@ -0,0 +1,99 @@
+
+
+ 4.0.0
+
+ com.pulumi
+ l2-plain
+ 1.0-SNAPSHOT
+
+
+ UTF-8
+ 11
+ 11
+ 11
+ generated_program.App
+
+
+
+
+
+ repository-0
+ REPOSITORY
+
+
+
+
+
+ com.pulumi
+ pulumi
+ CORE.VERSION
+
+
+ com.pulumi
+ plain
+ 13.0.0
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.2.2
+
+
+
+ true
+ ${mainClass}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.4.2
+
+
+
+ true
+ ${mainClass}
+
+
+
+ jar-with-dependencies
+
+
+
+
+ make-my-jar-with-dependencies
+ package
+
+ single
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 3.1.0
+
+ ${mainClass}
+ ${mainArgs}
+
+
+
+ org.apache.maven.plugins
+ maven-wrapper-plugin
+ 3.1.1
+
+ 3.8.5
+
+
+
+
+
\ No newline at end of file
diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/src/main/java/generated_program/App.java b/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/src/main/java/generated_program/App.java
new file mode 100644
index 00000000000..749df460a0b
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-plain/src/main/java/generated_program/App.java
@@ -0,0 +1,53 @@
+package generated_program;
+
+import com.pulumi.Context;
+import com.pulumi.Pulumi;
+import com.pulumi.core.Output;
+import com.pulumi.plain.Resource;
+import com.pulumi.plain.ResourceArgs;
+import com.pulumi.plain.inputs.DataArgs;
+import com.pulumi.plain.inputs.InnerDataArgs;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+public class App {
+ public static void main(String[] args) {
+ Pulumi.run(App::stack);
+ }
+
+ public static void stack(Context ctx) {
+ var res = new Resource("res", ResourceArgs.builder()
+ .data(DataArgs.builder()
+ .innerData(InnerDataArgs.builder()
+ .boolean_(false)
+ .float_(2.17)
+ .integer(-12)
+ .string("Goodbye")
+ .boolArray(
+ false,
+ true)
+ .stringMap(Map.ofEntries(
+ Map.entry("two", "turtle doves"),
+ Map.entry("three", "french hens")
+ ))
+ .build())
+ .boolean_(true)
+ .float_(4.5)
+ .integer(1024)
+ .string("Hello")
+ .boolArray(
+ true,
+ false)
+ .stringMap(Map.ofEntries(
+ Map.entry("x", "100"),
+ Map.entry("y", "200")
+ ))
+ .build())
+ .build());
+
+ }
+}
diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/Pulumi.yaml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/Pulumi.yaml
new file mode 100644
index 00000000000..e41010a1a86
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/Pulumi.yaml
@@ -0,0 +1,2 @@
+name: l2-primitive-ref
+runtime: java
diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/pom.xml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/pom.xml
new file mode 100644
index 00000000000..0fed0256f3c
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/pom.xml
@@ -0,0 +1,99 @@
+
+
+ 4.0.0
+
+ com.pulumi
+ l2-primitive-ref
+ 1.0-SNAPSHOT
+
+
+ UTF-8
+ 11
+ 11
+ 11
+ generated_program.App
+
+
+
+
+
+ repository-0
+ REPOSITORY
+
+
+
+
+
+ com.pulumi
+ pulumi
+ CORE.VERSION
+
+
+ com.pulumi
+ primitive-ref
+ 11.0.0
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.2.2
+
+
+
+ true
+ ${mainClass}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.4.2
+
+
+
+ true
+ ${mainClass}
+
+
+
+ jar-with-dependencies
+
+
+
+
+ make-my-jar-with-dependencies
+ package
+
+ single
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 3.1.0
+
+ ${mainClass}
+ ${mainArgs}
+
+
+
+ org.apache.maven.plugins
+ maven-wrapper-plugin
+ 3.1.1
+
+ 3.8.5
+
+
+
+
+
\ No newline at end of file
diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/src/main/java/generated_program/App.java b/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/src/main/java/generated_program/App.java
new file mode 100644
index 00000000000..b5a06423f53
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-primitive-ref/src/main/java/generated_program/App.java
@@ -0,0 +1,39 @@
+package generated_program;
+
+import com.pulumi.Context;
+import com.pulumi.Pulumi;
+import com.pulumi.core.Output;
+import com.pulumi.primitiveref.Resource;
+import com.pulumi.primitiveref.ResourceArgs;
+import com.pulumi.primitiveref.inputs.DataArgs;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+public class App {
+ public static void main(String[] args) {
+ Pulumi.run(App::stack);
+ }
+
+ public static void stack(Context ctx) {
+ var res = new Resource("res", ResourceArgs.builder()
+ .data(DataArgs.builder()
+ .boolean_(false)
+ .float_(2.17)
+ .integer(-12)
+ .string("Goodbye")
+ .boolArray(
+ false,
+ true)
+ .stringMap(Map.ofEntries(
+ Map.entry("two", "turtle doves"),
+ Map.entry("three", "french hens")
+ ))
+ .build())
+ .build());
+
+ }
+}
diff --git a/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/README.md b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/README.md
new file mode 100644
index 00000000000..8d1c8b69c3f
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/README.md
@@ -0,0 +1 @@
+
diff --git a/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/build.gradle b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/build.gradle
new file mode 100644
index 00000000000..561ec5d93f6
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/build.gradle
@@ -0,0 +1,157 @@
+// *** WARNING: this file was generated by pulumi-java-gen ***
+// *** Do not edit by hand unless you're certain you know what you are doing! ***
+
+plugins {
+ id("signing")
+ id("java-library")
+ id("maven-publish")
+}
+
+group = "com.pulumi"
+
+def resolvedVersion = System.getenv("PACKAGE_VERSION") ?:
+ (project.version == "unspecified"
+ ? "13.0.0"
+ : project.version)
+
+def signingKey = System.getenv("SIGNING_KEY")
+def signingPassword = System.getenv("SIGNING_PASSWORD")
+def publishRepoURL = System.getenv("PUBLISH_REPO_URL")
+def publishRepoUsername = System.getenv("PUBLISH_REPO_USERNAME")
+def publishRepoPassword = System.getenv("PUBLISH_REPO_PASSWORD")
+
+java {
+ toolchain {
+ languageVersion = JavaLanguageVersion.of(11)
+ }
+}
+
+compileJava {
+ options.fork = true
+ options.forkOptions.jvmArgs.addAll(["-Xmx16g"])
+ options.encoding = "UTF-8"
+}
+
+repositories {
+ maven {
+ url("REPOSITORY")
+ }
+ mavenLocal()
+ maven { // The google mirror is less flaky than mavenCentral()
+ url("https://maven-central.storage-download.googleapis.com/maven2/")
+ }
+ mavenCentral()
+}
+
+dependencies {
+ implementation("com.google.code.findbugs:jsr305:3.0.2")
+ implementation("com.google.code.gson:gson:2.8.9")
+ implementation("com.pulumi:pulumi:CORE.VERSION")
+}
+
+task sourcesJar(type: Jar) {
+ from sourceSets.main.allJava
+ archiveClassifier.set('sources')
+}
+
+task javadocJar(type: Jar) {
+ from javadoc
+ archiveClassifier.set('javadoc')
+ zip64 = true
+}
+
+def genPulumiResources = tasks.register('genPulumiResources') {
+ doLast {
+ def resourcesDir = sourceSets.main.output.resourcesDir
+ def subDir = project.name.replace(".", "/")
+ def outDir = file("$resourcesDir/$subDir")
+ outDir.mkdirs()
+ new File(outDir, "version.txt").text = resolvedVersion
+ def builder = new groovy.json.JsonBuilder()
+ builder {
+ resource true
+ name "plain"
+ version resolvedVersion
+ }
+ def infoJson = builder.toPrettyString()
+ new File(outDir, "plugin.json").text = infoJson
+ }
+}
+
+jar.configure {
+ dependsOn genPulumiResources
+}
+
+publishing {
+ publications {
+ mainPublication(MavenPublication) {
+ groupId = "com.pulumi"
+ artifactId = "plain"
+ version = resolvedVersion
+ from components.java
+ artifact sourcesJar
+ artifact javadocJar
+
+ pom {
+ inceptionYear = ""
+ name = ""
+ packaging = "jar"
+ description = " "
+
+ url = "https://example.com"
+
+ scm {
+ connection = "https://example.com"
+ developerConnection = "https://example.com"
+ url = "https://example.com"
+ }
+
+ licenses {
+ license {
+ name = ""
+ url = ""
+ }
+ }
+
+ developers {
+ developer {
+ id = ""
+ name = ""
+ email = ""
+ }
+ }
+ }
+ }
+ }
+
+ if (publishRepoURL) {
+ repositories {
+ maven {
+ name = "PublishRepo"
+ url = publishRepoURL
+ credentials {
+ username = publishRepoUsername
+ password = publishRepoPassword
+ }
+ }
+ }
+ }
+}
+
+javadoc {
+ if (JavaVersion.current().isJava9Compatible()) {
+ options.addBooleanOption('html5', true)
+ }
+ options.jFlags("-Xmx8g", "-Xms512m")
+}
+
+jar {
+ zip64 = true
+}
+
+if (signingKey) {
+ signing {
+ useInMemoryPgpKeys(signingKey, signingPassword)
+ sign publishing.publications.mainPublication
+ }
+}
\ No newline at end of file
diff --git a/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/settings.gradle b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/settings.gradle
new file mode 100644
index 00000000000..22486249500
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/settings.gradle
@@ -0,0 +1,14 @@
+// *** WARNING: this file was generated by pulumi-java-gen. ***
+// *** Do not edit by hand unless you're certain you know what you are doing! ***
+
+pluginManagement {
+ repositories {
+ maven { // The google mirror is less flaky than mavenCentral()
+ url("https://maven-central.storage-download.googleapis.com/maven2/")
+ }
+ gradlePluginPortal()
+ }
+}
+
+rootProject.name = "com.pulumi.plain"
+include("lib")
diff --git a/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/Provider.java b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/Provider.java
new file mode 100644
index 00000000000..b3a1cd4bc69
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/Provider.java
@@ -0,0 +1,54 @@
+// *** WARNING: this file was generated by pulumi-language-java. ***
+// *** Do not edit by hand unless you're certain you know what you are doing! ***
+
+package com.pulumi.plain;
+
+import com.pulumi.core.Output;
+import com.pulumi.core.annotations.ResourceType;
+import com.pulumi.core.internal.Codegen;
+import com.pulumi.plain.ProviderArgs;
+import com.pulumi.plain.Utilities;
+import javax.annotation.Nullable;
+
+@ResourceType(type="pulumi:providers:plain")
+public class Provider extends com.pulumi.resources.ProviderResource {
+ /**
+ *
+ * @param name The _unique_ name of the resulting resource.
+ */
+ public Provider(java.lang.String name) {
+ this(name, ProviderArgs.Empty);
+ }
+ /**
+ *
+ * @param name The _unique_ name of the resulting resource.
+ * @param args The arguments to use to populate this resource's properties.
+ */
+ public Provider(java.lang.String name, @Nullable ProviderArgs args) {
+ this(name, args, null);
+ }
+ /**
+ *
+ * @param name The _unique_ name of the resulting resource.
+ * @param args The arguments to use to populate this resource's properties.
+ * @param options A bag of options that control this resource's behavior.
+ */
+ public Provider(java.lang.String name, @Nullable ProviderArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
+ super("plain", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
+ }
+
+ private static ProviderArgs makeArgs(@Nullable ProviderArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
+ if (options != null && options.getUrn().isPresent()) {
+ return null;
+ }
+ return args == null ? ProviderArgs.Empty : args;
+ }
+
+ private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
+ var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
+ .version(Utilities.getVersion())
+ .build();
+ return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
+ }
+
+}
diff --git a/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/ProviderArgs.java b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/ProviderArgs.java
new file mode 100644
index 00000000000..a5140bc3b7a
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/ProviderArgs.java
@@ -0,0 +1,28 @@
+// *** WARNING: this file was generated by pulumi-language-java. ***
+// *** Do not edit by hand unless you're certain you know what you are doing! ***
+
+package com.pulumi.plain;
+
+
+
+
+public final class ProviderArgs extends com.pulumi.resources.ResourceArgs {
+
+ public static final ProviderArgs Empty = new ProviderArgs();
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static final class Builder {
+ private ProviderArgs $;
+
+ public Builder() {
+ $ = new ProviderArgs();
+ }
+ public ProviderArgs build() {
+ return $;
+ }
+ }
+
+}
diff --git a/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/Resource.java b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/Resource.java
new file mode 100644
index 00000000000..96c7d42751e
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/Resource.java
@@ -0,0 +1,93 @@
+// *** WARNING: this file was generated by pulumi-language-java. ***
+// *** Do not edit by hand unless you're certain you know what you are doing! ***
+
+package com.pulumi.plain;
+
+import com.pulumi.core.Output;
+import com.pulumi.core.annotations.Export;
+import com.pulumi.core.annotations.ResourceType;
+import com.pulumi.core.internal.Codegen;
+import com.pulumi.plain.ResourceArgs;
+import com.pulumi.plain.Utilities;
+import com.pulumi.plain.outputs.Data;
+import java.util.Optional;
+import javax.annotation.Nullable;
+
+@ResourceType(type="plain:index:Resource")
+public class Resource extends com.pulumi.resources.CustomResource {
+ @Export(name="data", refs={Data.class}, tree="[0]")
+ private Output data;
+
+ public Output data() {
+ return this.data;
+ }
+ /**
+ * A non plain input to compare against the plain inputs, as well as testing plain/non-plain nesting.
+ *
+ */
+ @Export(name="nonPlainData", refs={Data.class}, tree="[0]")
+ private Output* @Nullable */ Data> nonPlainData;
+
+ /**
+ * @return A non plain input to compare against the plain inputs, as well as testing plain/non-plain nesting.
+ *
+ */
+ public Output> nonPlainData() {
+ return Codegen.optional(this.nonPlainData);
+ }
+
+ /**
+ *
+ * @param name The _unique_ name of the resulting resource.
+ */
+ public Resource(java.lang.String name) {
+ this(name, ResourceArgs.Empty);
+ }
+ /**
+ *
+ * @param name The _unique_ name of the resulting resource.
+ * @param args The arguments to use to populate this resource's properties.
+ */
+ public Resource(java.lang.String name, ResourceArgs args) {
+ this(name, args, null);
+ }
+ /**
+ *
+ * @param name The _unique_ name of the resulting resource.
+ * @param args The arguments to use to populate this resource's properties.
+ * @param options A bag of options that control this resource's behavior.
+ */
+ public Resource(java.lang.String name, ResourceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
+ super("plain:index:Resource", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
+ }
+
+ private Resource(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
+ super("plain:index:Resource", name, null, makeResourceOptions(options, id), false);
+ }
+
+ private static ResourceArgs makeArgs(ResourceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
+ if (options != null && options.getUrn().isPresent()) {
+ return null;
+ }
+ return args == null ? ResourceArgs.Empty : args;
+ }
+
+ private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
+ var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
+ .version(Utilities.getVersion())
+ .build();
+ return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
+ }
+
+ /**
+ * Get an existing Host resource's state with the given name, ID, and optional extra
+ * properties used to qualify the lookup.
+ *
+ * @param name The _unique_ name of the resulting resource.
+ * @param id The _unique_ provider ID of the resource to lookup.
+ * @param options Optional settings to control the behavior of the CustomResource.
+ */
+ public static Resource get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
+ return new Resource(name, id, options);
+ }
+}
diff --git a/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/ResourceArgs.java b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/ResourceArgs.java
new file mode 100644
index 00000000000..590d7dee5b4
--- /dev/null
+++ b/pkg/cmd/pulumi-language-java/testdata/sdks/plain-13.0.0/src/main/java/com/pulumi/plain/ResourceArgs.java
@@ -0,0 +1,100 @@
+// *** WARNING: this file was generated by pulumi-language-java. ***
+// *** Do not edit by hand unless you're certain you know what you are doing! ***
+
+package com.pulumi.plain;
+
+import com.pulumi.core.Output;
+import com.pulumi.core.annotations.Import;
+import com.pulumi.exceptions.MissingRequiredPropertyException;
+import com.pulumi.plain.inputs.DataArgs;
+import java.util.Objects;
+import java.util.Optional;
+import javax.annotation.Nullable;
+
+
+public final class ResourceArgs extends com.pulumi.resources.ResourceArgs {
+
+ public static final ResourceArgs Empty = new ResourceArgs();
+
+ @Import(name="data", required=true)
+ private DataArgs data;
+
+ public DataArgs data() {
+ return this.data;
+ }
+
+ /**
+ * A non plain input to compare against the plain inputs, as well as testing plain/non-plain nesting.
+ *
+ */
+ @Import(name="nonPlainData")
+ private @Nullable Output nonPlainData;
+
+ /**
+ * @return A non plain input to compare against the plain inputs, as well as testing plain/non-plain nesting.
+ *
+ */
+ public Optional