1 package com.ashlux.mavenoc4jplugin;
2
3 import org.apache.maven.plugin.AbstractMojo;
4 import org.apache.maven.plugin.MojoExecutionException;
5 import org.apache.maven.plugin.MojoFailureException;
6
7 import java.io.IOException;
8
9 abstract public class AbstractOc4jMojo extends AbstractMojo {
10
11 final public void execute() throws MojoExecutionException, MojoFailureException {
12 String command = buildCommand();
13 try {
14 ProcessHelper.startProcess(command, getLog());
15 } catch (IOException e) {
16 getLog().error(e);
17 throw new MojoExecutionException("Failed to wait for java process. Sad Panda. :-(", e);
18 } catch (InterruptedException e) {
19 getLog().error(e);
20 throw new MojoExecutionException("Could not start java process. Sad Panda. :-(", e);
21 }
22 }
23
24
25 abstract String buildCommand();
26
27
28
29
30
31
32
33 private String javaHome;
34
35
36
37
38
39
40
41 private String j2eeHome;
42
43
44
45
46
47
48 private String adminJar;
49
50
51
52
53
54
55 private String connectionUri;
56
57
58
59
60
61
62
63 private String username;
64
65
66
67
68
69
70
71 private String password;
72
73 public String getJavaHome() {
74 return javaHome;
75 }
76
77 public void setJavaHome(String javaHome) {
78 this.javaHome = javaHome;
79 }
80
81 public String getJ2eeHome() {
82 return j2eeHome;
83 }
84
85 public void setJ2eeHome(String j2eeHome) {
86 this.j2eeHome = j2eeHome;
87 }
88
89 public String getAdminJar() {
90 return adminJar;
91 }
92
93 public void setAdminJar(String adminJar) {
94 this.adminJar = adminJar;
95 }
96
97 public String getConnectionUri() {
98 return connectionUri;
99 }
100
101 public void setConnectionUri(String connectionUri) {
102 this.connectionUri = connectionUri;
103 }
104
105 public String getUsername() {
106 return username;
107 }
108
109 public void setUsername(String username) {
110 this.username = username;
111 }
112
113 public String getPassword() {
114 return password;
115 }
116
117 public void setPassword(String password) {
118 this.password = password;
119 }
120 }