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

Avoid very unlikely NPE #10450

Merged
merged 1 commit into from
Jul 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,21 +407,25 @@ private void triggerCompile() throws MojoExecutionException {
*/
private void handleResources() throws MojoExecutionException {
List<Resource> resources = project.getResources();
if (!resources.isEmpty()) {
Plugin resourcesPlugin = project.getPlugin(ORG_APACHE_MAVEN_PLUGINS + ":" + MAVEN_RESOURCES_PLUGIN);
MojoExecutor.executeMojo(
MojoExecutor.plugin(
MojoExecutor.groupId(ORG_APACHE_MAVEN_PLUGINS),
MojoExecutor.artifactId(MAVEN_RESOURCES_PLUGIN),
MojoExecutor.version(resourcesPlugin.getVersion()),
resourcesPlugin.getDependencies()),
MojoExecutor.goal("resources"),
getPluginConfig(resourcesPlugin),
MojoExecutor.executionEnvironment(
project,
session,
pluginManager));
if (resources.isEmpty()) {
return;
}
Plugin resourcesPlugin = project.getPlugin(ORG_APACHE_MAVEN_PLUGINS + ":" + MAVEN_RESOURCES_PLUGIN);
if (resourcesPlugin == null) {
return;
}
MojoExecutor.executeMojo(
MojoExecutor.plugin(
MojoExecutor.groupId(ORG_APACHE_MAVEN_PLUGINS),
MojoExecutor.artifactId(MAVEN_RESOURCES_PLUGIN),
MojoExecutor.version(resourcesPlugin.getVersion()),
resourcesPlugin.getDependencies()),
MojoExecutor.goal("resources"),
getPluginConfig(resourcesPlugin),
MojoExecutor.executionEnvironment(
project,
session,
pluginManager));
}

private void executeCompileGoal(Plugin plugin, String groupId, String artifactId) throws MojoExecutionException {
Expand Down