|
78 | 78 | */
|
79 | 79 | public class Preferences {
|
80 | 80 |
|
| 81 | + private static final String IGNORE = "ignore"; |
81 | 82 | public static final String LINE = "line";
|
82 | 83 | /**
|
83 | 84 | * Specifies the folder path to the JDK .
|
@@ -306,6 +307,8 @@ public class Preferences {
|
306 | 307 |
|
307 | 308 | public static final String MAVEN_NOT_COVERED_PLUGIN_EXECUTION_SEVERITY = "java.configuration.maven.notCoveredPluginExecutionSeverity";
|
308 | 309 |
|
| 310 | + public static final String MAVEN_DEFAULT_MOJO_EXECUTION_ACTION = "java.configuration.maven.defaultMojoExecutionAction"; |
| 311 | + |
309 | 312 | /**
|
310 | 313 | * Preference key to enable/disable the 'completion'.
|
311 | 314 | */
|
@@ -596,6 +599,7 @@ public class Preferences {
|
596 | 599 | private String mavenUserSettings;
|
597 | 600 | private String mavenGlobalSettings;
|
598 | 601 | private String mavenNotCoveredPluginExecutionSeverity;
|
| 602 | + private String mavenDefaultMojoExecutionAction; |
599 | 603 |
|
600 | 604 | private List<String> javaCompletionFavoriteMembers;
|
601 | 605 | private List<?> gradleWrapperList;
|
@@ -853,7 +857,8 @@ public Preferences() {
|
853 | 857 | includeSourceMethodDeclarations = false;
|
854 | 858 | insertSpaces = true;
|
855 | 859 | tabSize = DEFAULT_TAB_SIZE;
|
856 |
| - mavenNotCoveredPluginExecutionSeverity = "ignore"; |
| 860 | + mavenNotCoveredPluginExecutionSeverity = IGNORE; |
| 861 | + mavenDefaultMojoExecutionAction = IGNORE; |
857 | 862 | inlayHintsParameterMode = InlayHintsParameterMode.LITERALS;
|
858 | 863 | projectEncoding = ProjectEncodingMode.IGNORE;
|
859 | 864 | avoidVolatileChanges = true;
|
@@ -1080,9 +1085,12 @@ public static Preferences createFrom(Map<String, Object> configuration) {
|
1080 | 1085 | String mavenGlobalSettings = getString(configuration, MAVEN_GLOBAL_SETTINGS_KEY, null);
|
1081 | 1086 | prefs.setMavenGlobalSettings(mavenGlobalSettings);
|
1082 | 1087 |
|
1083 |
| - String mavenNotCoveredPluginExecution = getString(configuration, MAVEN_NOT_COVERED_PLUGIN_EXECUTION_SEVERITY, "ignore"); |
| 1088 | + String mavenNotCoveredPluginExecution = getString(configuration, MAVEN_NOT_COVERED_PLUGIN_EXECUTION_SEVERITY, IGNORE); |
1084 | 1089 | prefs.setMavenNotCoveredPluginExecutionSeverity(mavenNotCoveredPluginExecution);
|
1085 | 1090 |
|
| 1091 | + String mavenDefaultMojoExecution = getString(configuration, MAVEN_DEFAULT_MOJO_EXECUTION_ACTION, IGNORE); |
| 1092 | + prefs.setMavenDefaultMojoExecutionAction(mavenDefaultMojoExecution); |
| 1093 | + |
1086 | 1094 | String sortOrder = getString(configuration, MEMBER_SORT_ORDER, null);
|
1087 | 1095 | prefs.setMembersSortOrder(sortOrder);
|
1088 | 1096 |
|
@@ -1816,8 +1824,31 @@ public String getMavenNotCoveredPluginExecutionSeverity() {
|
1816 | 1824 | return mavenNotCoveredPluginExecutionSeverity;
|
1817 | 1825 | }
|
1818 | 1826 |
|
1819 |
| - public void setMavenNotCoveredPluginExecutionSeverity(String mavenNotCoveredPluginExecutionSeverity) { |
| 1827 | + public Preferences setMavenNotCoveredPluginExecutionSeverity(String mavenNotCoveredPluginExecutionSeverity) { |
1820 | 1828 | this.mavenNotCoveredPluginExecutionSeverity = mavenNotCoveredPluginExecutionSeverity;
|
| 1829 | + return this; |
| 1830 | + } |
| 1831 | + |
| 1832 | + public String getMavenDefaultMojoExecutionAction() { |
| 1833 | + return mavenDefaultMojoExecutionAction; |
| 1834 | + } |
| 1835 | + |
| 1836 | + public Preferences setMavenDefaultMojoExecutionAction(String mavenDefaultMojoExecutionAction) { |
| 1837 | + if (mavenDefaultMojoExecutionAction == null) { |
| 1838 | + mavenDefaultMojoExecutionAction = IGNORE; |
| 1839 | + } |
| 1840 | + switch (mavenDefaultMojoExecutionAction) { |
| 1841 | + case IGNORE: |
| 1842 | + case "execute": |
| 1843 | + case "warn": |
| 1844 | + case "error": |
| 1845 | + break; |
| 1846 | + default: |
| 1847 | + mavenDefaultMojoExecutionAction = IGNORE; |
| 1848 | + break; |
| 1849 | + } |
| 1850 | + this.mavenDefaultMojoExecutionAction = mavenDefaultMojoExecutionAction; |
| 1851 | + return this; |
1821 | 1852 | }
|
1822 | 1853 |
|
1823 | 1854 | public String[] getImportOrder() {
|
|
0 commit comments