View Javadoc

1   package org.apache.torque.mojo;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.commons.configuration.PropertiesConfiguration;
23  import org.apache.maven.plugin.MojoExecutionException;
24  import org.apache.torque.task.TorqueSQLTask;
25  
26  /**
27   * Generates SQL for creating the database from the schema.xml files.
28   *
29   * @author Raphael Pieroni (rafale_at_codehaus.org)
30   * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
31   * @author <a href="kannegiesser@synyx.de">Marc Kannegiesser</a>
32   *
33   * @goal sql
34   * @phase generate-sources
35   */
36  public class SqlMojo extends SqlMojoBase
37  {
38      // The following three dummies trick the Mojo Description Extractor
39      // into setting the correct default values for
40      // outputDir, reportFile, contextPropertiesPath, schemaExcludes, suffix.
41      /**
42       * The directory in which the SQL will be generated.
43       *
44       * @parameter property="outputDir"
45       *            expression="${project.build.directory}/generated-sql/torque"
46       */
47      private String dummy;
48  
49      /**
50       * The location where the report file will be generated.
51       *
52       * @parameter property="reportFile"
53       *            expression="../../torque/report.${project.artifact.artifactId}.sql.generation"
54       */
55      private String dummy2;
56  
57      /**
58       * The location where the context property file for velocity will be
59       * generated.
60       *
61       * @parameter property="contextPropertiesPath"
62       *            expression="${project.build.directory}/torque/context.sql.properties"
63       */
64      private String dummy3;
65  
66      /**
67       * The schema files which should be excluded in generation
68       * (in ant-style notation).
69       *
70       * @parameter property="schemaExcludes" expression=""
71       */
72      private String dummy4;
73  
74      /**
75       * The suffix of the generated sql files.
76       *
77       * @parameter property="suffix"
78       *            expression=""
79       */
80      private String dummy5;
81  }