diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java index efd0721b347eeb..c039722eb02e66 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaImport.java @@ -161,9 +161,16 @@ protected void collect(CcLinkParams.Builder builder, boolean linkingStatically, .setSourceJarsProvider(sourceJarsProvider) .setCompilationArgsProvider(compilationArgsProvider); common.addTransitiveInfoProviders(ruleBuilder, skylarkApiProvider, filesToBuild, null); + JavaProvider javaProvider = JavaProvider.Builder.create() + .addProvider(JavaCompilationArgsProvider.class, compilationArgsProvider) + .addProvider(JavaRuleOutputJarsProvider.class, ruleOutputJarsProvider) + .addProvider(JavaSourceJarsProvider.class, sourceJarsProvider) + .build(); return ruleBuilder .setFilesToBuild(filesToBuild) .addSkylarkTransitiveInfo(JavaSkylarkApiProvider.NAME, skylarkApiProvider.build()) + .addNativeDeclaredProvider(javaProvider) + .addProvider(JavaProvider.class, javaProvider) .add(JavaRuleOutputJarsProvider.class, ruleOutputJarsProvider) .add( JavaRuntimeJarProvider.class,