diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java index 25658ea171..3c92aa3caf 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java @@ -560,16 +560,20 @@ private void applyBestOfCurrentOrConfiguredProfile(String configuredProfileName, MavenSession mavenSession, ExecutionEnvironmentConfiguration sink) { StandardExecutionEnvironment configuredProfile = ExecutionEnvironmentUtils .getExecutionEnvironment(configuredProfileName, toolchainManager, mavenSession, logger); - if (configuredProfile != null) { - // non standard profile, stick to it - sink.setProfileConfiguration(configuredProfileName, reason); + if (configuredProfile == null) { + //should never be the case as Tycho delegates to other profiles, but if we need to stick to the defaults... + return; } - StandardExecutionEnvironment currentProfile = ExecutionEnvironmentUtils.getExecutionEnvironment( - "JavaSE-" + Runtime.version().feature(), toolchainManager, mavenSession, logger); - if (currentProfile.compareTo(configuredProfile) > 0) { - sink.setProfileConfiguration(currentProfile.getProfileName(), - "Currently running profile, newer than configured profile (" + configuredProfileName + ") from [" - + reason + "]"); + if (sink.isIgnoredByResolver()) { + StandardExecutionEnvironment currentProfile = ExecutionEnvironmentUtils.getExecutionEnvironment( + "JavaSE-" + Runtime.version().feature(), toolchainManager, mavenSession, logger); + if (currentProfile != null && currentProfile.compareTo(configuredProfile) > 0) { + sink.setProfileConfiguration(currentProfile.getProfileName(), + "Currently running profile, newer than configured profile (" + configuredProfileName + + ") from [" + reason + "]"); + } else { + sink.setProfileConfiguration(configuredProfileName, reason); + } } else { sink.setProfileConfiguration(configuredProfileName, reason); }