Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtimeOnly dependencies to quarkusDev classpath #18139

Merged
merged 1 commit into from
Jun 28, 2021

Conversation

glefloch
Copy link
Member

This adds runtime dependencies to module classpath for devmode.

close #18117

@glefloch glefloch requested a review from aloubyansky June 24, 2021 19:06
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Jun 24, 2021
@@ -335,7 +335,7 @@ private void addSelfWithLocalDeps(Project project, GradleDevModeLauncher.Builder
if (!visited.add(project.getPath())) {
return;
}
final Configuration compileCp = project.getConfigurations().findByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME);
final Configuration compileCp = project.getConfigurations().findByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could also be a compile-only config which is relevant in dev mode, e.g. lombok. Could you check please?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try adding lombok to the reproducer. The dev mode starts correctly, and if I update the class (e.g adding @log) it works too.
Doesn't the dev mode rely on the model to create a compile classpath that is used to recompile updated files ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. In this method we are determining locally available projects that should be hot-reloadable. So if there is compileOnly dependency on a local project, changes to that project won't be triggering a reload. So, lombok isn't a good test in this case. You see what I mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I see, it looks completely logical, I will update the branch

Copy link
Member Author

@glefloch glefloch Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aloubyansky I updated the code to take care of compileOnly dependencies.

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 24, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 3132008

Status Name Step Test failures Logs Raw logs
Native Tests - Misc4 Build ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 25, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building ef0bedf

Status Name Step Test failures Logs Raw logs
Gradle Tests - JDK 11 Build Test failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ Gradle Tests - JDK 11 #

📦 integration-tests/gradle

io.quarkus.gradle.devmode.AvroDevModeTest.main() line 15 - More details - Source on GitHub

io.quarkus.gradle.devmode.BasicJavaLibraryModuleDevModeTest.main() line 24 - More details - Source on GitHub

io.quarkus.gradle.devmode.BasicJavaPlatformModuleDevModeTest.main() line 24 - More details - Source on GitHub

io.quarkus.gradle.devmode.BasicMultiModuleProjectDevModeTest.main() line 22 - More details - Source on GitHub

io.quarkus.gradle.devmode.CustomQuarkusDevModeConfigurationTest.main() line 13 - More details - Source on GitHub

io.quarkus.gradle.devmode.DotEnvQuarkusDevModeConfigurationTest.main() line 13 - More details - Source on GitHub

io.quarkus.gradle.devmode.ImplementationFilesDevModeTest.main() line 21 - More details - Source on GitHub

io.quarkus.gradle.devmode.InjectQuarkusAppPropertiesDevModeTest.main() line 19 - More details - Source on GitHub

io.quarkus.gradle.devmode.JandexMultiModuleProjectDevModeTest.main() line 21 - More details - Source on GitHub

io.quarkus.gradle.devmode.ModuleWithParentDependencyDevModeTest.main() line 14 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleIncludedBuildTest.main() line 24 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleKotlinProjectDevModeTest.main() line 22 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleNamedInjectionDevModeTest.main() line 21 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleWithEmptyModuleDevModeTest.main() line 22 - More details - Source on GitHub

io.quarkus.gradle.devmode.QuarkusDevDependencyDevModeTest.main() line 14 - More details - Source on GitHub

io.quarkus.gradle.devmode.ResourcesInBuildStepsDevModeTest.main() line 29 - More details - Source on GitHub


⚙️ Gradle Tests - JDK 11 Windows #

📦 integration-tests/gradle

io.quarkus.gradle.devmode.AvroDevModeTest.main() line 15 - More details - Source on GitHub

io.quarkus.gradle.devmode.BasicJavaLibraryModuleDevModeTest.main() line 24 - More details - Source on GitHub

io.quarkus.gradle.devmode.BasicJavaPlatformModuleDevModeTest.main() line 24 - More details - Source on GitHub

io.quarkus.gradle.devmode.BasicMultiModuleProjectDevModeTest.main() line 22 - More details - Source on GitHub

io.quarkus.gradle.devmode.CustomQuarkusDevModeConfigurationTest.main() line 13 - More details - Source on GitHub

io.quarkus.gradle.devmode.DotEnvQuarkusDevModeConfigurationTest.main() line 13 - More details - Source on GitHub

io.quarkus.gradle.devmode.ImplementationFilesDevModeTest.main() line 21 - More details - Source on GitHub

io.quarkus.gradle.devmode.InjectQuarkusAppPropertiesDevModeTest.main() line 19 - More details - Source on GitHub

io.quarkus.gradle.devmode.JandexMultiModuleProjectDevModeTest.main() line 21 - More details - Source on GitHub

io.quarkus.gradle.devmode.ModuleWithParentDependencyDevModeTest.main() line 14 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleIncludedBuildTest.main() line 24 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleKotlinProjectDevModeTest.main() line 22 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleNamedInjectionDevModeTest.main() line 21 - More details - Source on GitHub

io.quarkus.gradle.devmode.MultiModuleWithEmptyModuleDevModeTest.main() line 22 - More details - Source on GitHub

io.quarkus.gradle.devmode.QuarkusDevDependencyDevModeTest.main() line 14 - More details - Source on GitHub

io.quarkus.gradle.devmode.ResourcesInBuildStepsDevModeTest.main() line 29 - More details - Source on GitHub

@@ -335,7 +335,9 @@ private void addSelfWithLocalDeps(Project project, GradleDevModeLauncher.Builder
if (!visited.add(project.getPath())) {
return;
}
final Configuration compileCp = project.getConfigurations().findByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME);
final Configuration compileCp = project.getConfigurations().create("compileCp")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent we could use QuarkusPlugin.DEV_MODE_CONFIGURATION_NAME, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it should already be available?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and it will also include ˋquarkusDev dependency. This configuration only includes runtime classpath plus ˋcompileOnly artifacts. I will add runtimeOnly artifacts too.

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 25, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 5b36fed

Status Name Step Test failures Logs Raw logs
Gradle Tests - JDK 11 Build Test failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ Gradle Tests - JDK 11 #

📦 integration-tests/gradle

io.quarkus.gradle.devmode.BasicJavaPlatformModuleDevModeTest.main() line 24 - More details - Source on GitHub


⚙️ Gradle Tests - JDK 11 Windows #

📦 integration-tests/gradle

io.quarkus.gradle.devmode.BasicJavaPlatformModuleDevModeTest.main() line 24 - More details - Source on GitHub

@glefloch
Copy link
Member Author

@aloubyansky I updated the code, and the build is successful, is it ok for you?

@@ -204,7 +204,8 @@ public void execute(Task test) {
// create a custom configuration for devmode
configurations.create(DEV_MODE_CONFIGURATION_NAME).extendsFrom(
configurations.getByName(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME),
configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME));
configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME),
configurations.getByName(JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't RUNTIM_CLASSPATH include RUNTIME_ONLY?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this works, I pushed the update.

@aloubyansky aloubyansky added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 28, 2021
@glefloch glefloch merged commit 8fda467 into quarkusio:main Jun 28, 2021
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 28, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 28, 2021
@glefloch glefloch deleted the fix/18117 branch June 28, 2021 09:12
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 28, 2021

🚫 This workflow run has been cancelled.

✖ This workflow run has failed but no jobs reported an error. Something weird happened, please check the workflow run page carefully: it might be an issue with the workflow configuration itself.

@glefloch
Copy link
Member Author

@gsmet I waited for the CI to be done before merging, but the bot reported the job as cancelled. Looking at the workflow run page, I don't see which job has been cancel. Is there a problem with the bot?

@gsmet gsmet modified the milestones: 2.1 - main, 2.0.1.Final Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Injecting from another module causes ClassNotFoundException in dev mode
3 participants