diff --git a/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentConfiguration.java b/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentConfiguration.java index 29fe205e7f..43dd04ce03 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentConfiguration.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/ExecutionEnvironmentConfiguration.java @@ -86,6 +86,10 @@ public void setFullSpecificationForCustomProfile(List systemCa public boolean isIgnoredByResolver(); + default boolean isResolveWithEEConstraints() { + return !isIgnoredByResolver(); + } + /** * @return all known Execution Environments accessible for the same scope */ 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..e4b2531f19 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,18 +560,22 @@ 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 + "]"); - } else { + if (sink.isResolveWithEEConstraints()) { sink.setProfileConfiguration(configuredProfileName, reason); + } else { + 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); + } } }