Skip to content

Commit

Permalink
chore: do not log incompatibility if project dependencies are not res…
Browse files Browse the repository at this point in the history
…olved (#20682)

Depending on the phase maven goals are executed, the project dependencies
might not have been resolved, making the Flow incompatibility log message
useless (e.g when running clean-frontend).
This change prevents the message to be printed if project Flow version
cannot be detected.
  • Loading branch information
mcollovati authored Dec 13, 2024
1 parent a2da336 commit 64efd11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,8 @@ private void checkFlowCompatibility(PluginDescriptor pluginDescriptor) {
String pluginFlowVersion = pluginDescriptor.getArtifacts().stream()
.filter(isFlowServer).map(Artifact::getVersion).findFirst()
.orElse(null);
if (!Objects.equals(projectFlowVersion, pluginFlowVersion)) {
if (projectFlowVersion != null
&& !Objects.equals(projectFlowVersion, pluginFlowVersion)) {
getLog().warn(
"Vaadin Flow used in project does not match the version expected by the Vaadin plugin. "
+ "Flow version for project is "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.vaadin.flow.plugin.maven;

import javax.inject.Inject;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -53,7 +52,6 @@
import com.vaadin.flow.plugin.base.BuildFrontendUtil;
import com.vaadin.flow.plugin.base.PluginAdapterBase;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.ExecutionFailedException;
import com.vaadin.flow.server.InitParameters;
import com.vaadin.flow.server.frontend.FrontendTools;
import com.vaadin.flow.server.frontend.FrontendUtils;
Expand Down Expand Up @@ -271,7 +269,6 @@ public abstract class FlowModeAbstractMojo extends AbstractMojo
* <configuration>
* <frontendExtraFileExtensions>svg,ico</frontendExtraFileExtensions>
* </configuration>
*
*/
@Parameter(property = InitParameters.FRONTEND_EXTRA_EXTENSIONS, defaultValue = "${null}")
private List<String> frontendExtraFileExtensions;
Expand Down Expand Up @@ -720,7 +717,8 @@ private void checkFlowCompatibility(PluginDescriptor pluginDescriptor) {
String pluginFlowVersion = pluginDescriptor.getArtifacts().stream()
.filter(isFlowServer).map(Artifact::getBaseVersion).findFirst()
.orElse(null);
if (!Objects.equals(projectFlowVersion, pluginFlowVersion)) {
if (projectFlowVersion != null
&& !Objects.equals(projectFlowVersion, pluginFlowVersion)) {
getLog().warn(
"Vaadin Flow used in project does not match the version expected by the Vaadin plugin. "
+ "Flow version for project is "
Expand Down

0 comments on commit 64efd11

Please sign in to comment.