Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. public static WebArchive createDeployment() {
  2. File file = new File("pom.xml");
  3. if (!file.exists()) {
  4. throw new IllegalStateException("The file (" + file + ") does not exist.\n"
  5. + "This test needs to be run with the working directory optaconf-webapp-test.");
  6. }
  7. try {
  8. file = file.getCanonicalFile();
  9. } catch (IOException e) {
  10. throw new IllegalStateException("Could not get cannonical file for file (" + file + ").", e);
  11. }
  12. if (!file.getParentFile().getName().equals("optaconf-webapp-test")) {
  13. throw new IllegalStateException("The file (" + file + ") is not correct.\n"
  14. + "This test needs to be run with the working directory optaconf-webapp-test.");
  15. }
  16. return Maven.resolver()
  17. .loadPomFromFile(file)
  18. .resolve("org.optaconf:optaconf-webapp:war:?")
  19. .withoutTransitivity()
  20. .asSingle(WebArchive.class);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement