Skip to content

Commit

Permalink
Bugfix Profile does not exist on one side
Browse files Browse the repository at this point in the history
  • Loading branch information
cecom committed Jun 8, 2015
1 parent d40e05f commit 7c9e30b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/main/java/de/oppermann/pomutils/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* under the License.
*/

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.impl.SimpleLogger;
Expand All @@ -43,7 +44,14 @@ public class Main {
private static Logger logger = null;

public static void main(String... args) {
int resultValue = mainInternal(args);
int resultValue = 0;
try {
resultValue = mainInternal(args);
} catch (Exception e) {
System.err.println("We got an exception on merge: " + StringUtils.join(args, " "));
e.printStackTrace();
System.exit(1);
}
logger.debug("Exiting with exit code {}", resultValue);
System.exit(resultValue);
}
Expand Down Expand Up @@ -84,7 +92,8 @@ protected static int mainInternal(String... args) {
}

private static int executePomMergeDriver(CommandPomMergeDriver mergeCommand) {
PomMergeDriver pomMergeDriver = new PomMergeDriver(mergeCommand.getRuleSet(), mergeCommand.getBasePom(), mergeCommand.getOurPom(),
PomMergeDriver pomMergeDriver = new PomMergeDriver(mergeCommand.getRuleSet(), mergeCommand.getBasePom(),
mergeCommand.getOurPom(),
mergeCommand.getTheirPom());
return pomMergeDriver.merge();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/oppermann/pomutils/util/POM.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public Properties getProfileProperties(String profileId) {
return profile.getProperties();
}
}
throw new IllegalArgumentException("profile [" + profileId + "] not found");
return new Properties();
}

public Properties getProperties() {
Expand Down

0 comments on commit 7c9e30b

Please sign in to comment.