1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.torque.mojo;
17
18 import java.io.File;
19
20 import org.apache.maven.plugin.MojoExecutionException;
21 import org.apache.torque.mojo.morph.MorphRequest;
22 import org.apache.torque.mojo.morph.Morpher;
23 import org.apache.torque.mojo.morph.SchemaMorpher;
24
25
26
27
28
29
30
31 public class MorphSchemaMojo extends AbstractMorphSingleMojo {
32
33
34
35
36
37
38
39
40 private File newSchemaXMLFile;
41
42
43
44
45
46
47
48 private File oldSchemaXMLFile;
49
50 @Override
51 protected void beforeExecution() {
52 setNewFile(newSchemaXMLFile);
53 setOldFile(oldSchemaXMLFile);
54 }
55
56 @Override
57 protected void executeMojo() throws MojoExecutionException {
58 getLog().info("------------------------------------------------------------------------");
59 getLog().info("Converting schema XML file");
60 getLog().info("------------------------------------------------------------------------");
61 super.executeMojo();
62 }
63
64 @Override
65 protected Morpher getMorpher(final MorphRequest request, final String artifactId) {
66 return new SchemaMorpher(request, artifactId);
67 }
68
69 public File getNewSchemaXMLFile() {
70 return newSchemaXMLFile;
71 }
72
73 public void setNewSchemaXMLFile(final File newSchemaXMLFile) {
74 this.newSchemaXMLFile = newSchemaXMLFile;
75 }
76
77 public File getOldSchemaXMLFile() {
78 return oldSchemaXMLFile;
79 }
80
81 public void setOldSchemaXMLFile(final File oldSchemaXMLFile) {
82 this.oldSchemaXMLFile = oldSchemaXMLFile;
83 }
84 }