You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tv...@apache.org on 2006/11/11 23:32:43 UTC
svn commit: r473817 [1/3] - in /db/torque: maven-plugin/trunk/
maven-plugin/trunk/src/plugin-resources/templates/
maven-plugin/trunk/xdocs/ maven2-plugin/trunk/
maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/
maven2-plugin/trunk/src/test/java...
Author: tv
Date: Sat Nov 11 14:32:42 2006
New Revision: 473817
URL: http://svn.apache.org/viewvc?view=rev&rev=473817
Log: (empty)
Modified:
db/torque/maven-plugin/trunk/maven.xml
db/torque/maven-plugin/trunk/plugin.jelly
db/torque/maven-plugin/trunk/plugin.properties
db/torque/maven-plugin/trunk/project.properties
db/torque/maven-plugin/trunk/project.xml
db/torque/maven-plugin/trunk/src/plugin-resources/templates/index.jelly
db/torque/maven-plugin/trunk/xdocs/goals.xml
db/torque/maven-plugin/trunk/xdocs/index.xml
db/torque/maven-plugin/trunk/xdocs/navigation.xml
db/torque/maven-plugin/trunk/xdocs/properties.xml
db/torque/maven2-plugin/trunk/pom.xml
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataDumpMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataModelTaskMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataSqlMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DocumentationMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/OMMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/TexenTaskMojo.java
db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/package.html
db/torque/maven2-plugin/trunk/src/test/java/org/apache/torque/mojo/TorqueOMMojoTest.java
db/torque/maven2-plugin/trunk/src/test/java/org/apache/torque/mojo/TorqueSQLMojoTest.java
db/torque/maven2-plugin/trunk/src/test/resources/projects/TorqueOMMojoTest/pom.xml
db/torque/maven2-plugin/trunk/src/test/resources/projects/TorqueOMMojoTest/src/main/torque/schema/id-table-schema.xml
db/torque/maven2-plugin/trunk/src/test/resources/projects/TorqueOMMojoTest/src/main/torque/schema/test-TorqueOMMojoTest-schema.xml
Modified: db/torque/maven-plugin/trunk/maven.xml
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/maven.xml?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/maven.xml (original)
+++ db/torque/maven-plugin/trunk/maven.xml Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<!-- ======================================================================== -->
Modified: db/torque/maven-plugin/trunk/plugin.jelly
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/plugin.jelly?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/plugin.jelly (original)
+++ db/torque/maven-plugin/trunk/plugin.jelly Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<!-- ======================================================================== -->
Modified: db/torque/maven-plugin/trunk/plugin.properties
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/plugin.properties?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/plugin.properties (original)
+++ db/torque/maven-plugin/trunk/plugin.properties Sat Nov 11 14:32:42 2006
@@ -1,16 +1,19 @@
-# Copyright 2001-2005 The Apache Software Foundation.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
#
-# Licensed under the Apache License, Version 2.0 (the "License")
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
# -------------------------------------------------------------------
# P L U G I N P R O P E R T I E S
Modified: db/torque/maven-plugin/trunk/project.properties
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/project.properties?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/project.properties (original)
+++ db/torque/maven-plugin/trunk/project.properties Sat Nov 11 14:32:42 2006
@@ -1,16 +1,19 @@
-# Copyright 2001-2005 The Apache Software Foundation.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
#
-# Licensed under the Apache License, Version 2.0 (the "License")
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
# -------------------------------------------------------------------
# P R O J E C T P R O P E R T I E S
@@ -27,4 +30,4 @@
# Project documentation is included manually
maven.xdoc.includeProjectDocumentation = no
-maven.linkcheck.exclude=http://svn.apache.org,..
\ No newline at end of file
+maven.linkcheck.exclude=http://svn.apache.org,..
Modified: db/torque/maven-plugin/trunk/project.xml
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/project.xml?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/project.xml (original)
+++ db/torque/maven-plugin/trunk/project.xml Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<project>
Modified: db/torque/maven-plugin/trunk/src/plugin-resources/templates/index.jelly
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/src/plugin-resources/templates/index.jelly?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/src/plugin-resources/templates/index.jelly (original)
+++ db/torque/maven-plugin/trunk/src/plugin-resources/templates/index.jelly Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<j:whitespace xmlns:j="jelly:core"
xmlns:util="jelly:util"
Modified: db/torque/maven-plugin/trunk/xdocs/goals.xml
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/xdocs/goals.xml?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/xdocs/goals.xml (original)
+++ db/torque/maven-plugin/trunk/xdocs/goals.xml Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<document>
Modified: db/torque/maven-plugin/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/xdocs/index.xml?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/xdocs/index.xml (original)
+++ db/torque/maven-plugin/trunk/xdocs/index.xml Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<document>
Modified: db/torque/maven-plugin/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/xdocs/navigation.xml?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/xdocs/navigation.xml (original)
+++ db/torque/maven-plugin/trunk/xdocs/navigation.xml Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<!DOCTYPE project [
<!ENTITY torque-nav SYSTEM "../../torque-nav-inc.xml">
Modified: db/torque/maven-plugin/trunk/xdocs/properties.xml
URL: http://svn.apache.org/viewvc/db/torque/maven-plugin/trunk/xdocs/properties.xml?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven-plugin/trunk/xdocs/properties.xml (original)
+++ db/torque/maven-plugin/trunk/xdocs/properties.xml Sat Nov 11 14:32:42 2006
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- Copyright 2001-2005 The Apache Software Foundation.
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- Licensed under the Apache License, Version 2.0 (the "License")
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
-->
<document>
<properties>
Modified: db/torque/maven2-plugin/trunk/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/pom.xml?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven2-plugin/trunk/pom.xml (original)
+++ db/torque/maven2-plugin/trunk/pom.xml Sat Nov 11 14:32:42 2006
@@ -1,106 +1,124 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.apache.db.torque</groupId>
- <artifactId>torque</artifactId>
- <version>3.2.1-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>torque-maven-plugin</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Torque Maven2 Plugin</name>
- <description>Maven 2 plugin for the Torque Generator</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-settings</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-descriptor</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <version>2.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.db.torque</groupId>
- <artifactId>generator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>1.0.4</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.8</version>
- </dependency>
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- <version>1.2</version>
- </dependency>
-
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>3.1.11</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/TorqueOMMojoTest.java</include>
- <include>**/TorqueSQLMojoTest.java</include>
- <include>**/TorqueDataDtdMojoTest.java</include>
- <include>**/TorqueDataSQLMojoTest.java</include>
- <include>**/TorqueInsertSQLMojoTest.java</include>
- <include>**/TorqueJDBCTest.java</include>
- <include>**/TorqueDataDumpMojoTest.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
-</project>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.db.torque</groupId>
+ <artifactId>torque</artifactId>
+ <version>3.2.1-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>torque-maven-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>Torque Maven2 Plugin</name>
+ <description>Maven 2 plugin for the Torque Generator</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-settings</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-descriptor</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>2.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.db.torque</groupId>
+ <artifactId>generator</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>3.1.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/TorqueOMMojoTest.java</include>
+ <include>**/TorqueSQLMojoTest.java</include>
+ <include>**/TorqueDataDtdMojoTest.java</include>
+ <include>**/TorqueDataSQLMojoTest.java</include>
+ <include>**/TorqueInsertSQLMojoTest.java</include>
+ <include>**/TorqueJDBCTest.java</include>
+ <include>**/TorqueDataDumpMojoTest.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Modified: db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataDumpMojo.java
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataDumpMojo.java?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataDumpMojo.java (original)
+++ db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataDumpMojo.java Sat Nov 11 14:32:42 2006
@@ -1,265 +1,268 @@
-package org.apache.torque.mojo;
-
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.torque.task.TorqueDataDumpTask;
-
-/**
- * Reads the content of tables from thh database and stores the data
- * in XML files.
- *
- * @author Raphael Pieroni (rafale_at_codehaus.org)
- * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
- *
- * @goal datadump
- * @phase generate-sources
- */
-public class DataDumpMojo extends DataModelTaskMojo
-{
- /** The context property for the name of the project. */
- public static final String PROJECT_CONTEXT_PROPERTY
- = "project";
-
- // The following three dummies trick the Mojo Description Extractor
- // into setting the correct default values for
- // outputDir, reportFile and contextPropertiesPath
- /**
- * The directory in which the data files will be created.
- *
- * @parameter property="outputDir"
- * expression="${project.build.directory}/data/torque"
- */
- private String dummy;
-
- /**
- * The location where the report file will be generated.
- *
- * @parameter property="reportFile"
- * expression="../../torque/report.${project.artifact.artifactId}.data.generation"
- */
- private String dummy2;
-
- /**
- * The location where the context property file for velocity will be
- * generated.
- *
- * @parameter property="contextPropertiesPath"
- * expression="${project.build.directory}/torque/context.data.properties"
- */
- private String dummy3;
-
- /**
- * The fully qualified class name of the database driver.
- *
- * @parameter
- * @required
- */
- private String driver = null;
-
- /**
- * The connect URL of the database.
- *
- * @parameter
- * @required
- */
- private String url = null;
-
- /**
- * The user name to connect to the database.
- *
- * @parameter
- * @required
- */
- private String user = null;
-
- /**
- * The password for the database user.
- *
- * @parameter
- */
- private String password = null;
-
- /**
- * The name of the project, used as a prefix of the names
- * of the generated files and the name of the datadtd.
- *
- * @parameter expression="torque"
- */
- private String projectName = null;
-
- /**
- * Creates a new SQLMojo object.
- */
- public DataDumpMojo()
- {
- super(new TorqueDataDumpTask());
- }
-
- /**
- * Returns the path to the control template.
- *
- * @return "data/Control.vm"
- */
- protected String getControlTemplate()
- {
- return "data/dump/Control.vm";
- }
-
- /**
- * Returns the context properties for the Texen task.
- *
- * @return The PropertiesConfiguration containing all context properties,
- * not null.
- */
- protected PropertiesConfiguration getMojoContextProperties()
- {
- PropertiesConfiguration configuration = new PropertiesConfiguration();
- configuration.addProperty(PROJECT_CONTEXT_PROPERTY, projectName);
- return configuration;
- }
-
- /**
- * Configures the Texen task which is wrapped by this mojo.
- * In this implementation, the context properties, useClasspath,
- * the output directory, the control template, the schema Fileset,
- * the target package and the target database are set.
- *
- * @throws MojoExecutionException if an error occurs when setting the Tasks
- * properties.
- *
- * @see TexenTaskMojo#configureTask()
- */
- protected void configureTask() throws MojoExecutionException
- {
- super.configureTask();
-
- TorqueDataDumpTask task
- = (TorqueDataDumpTask) super.getGeneratorTask();
-
- task.setDatabaseDriver(driver);
-
- task.setDatabaseUrl(url);
-
- task.setDatabaseUser(user);
-
- task.setDatabasePassword(password);
- }
-
- /**
- * Returns the fully qualified class name of the database driver.
- *
- * @return the fully qualified class name of the database driver.
- */
- public String getDriver()
- {
- return driver;
- }
-
- /**
- * Sets the fully qualified class name of the database driver.
- *
- * @param driver the fully qualified class name of the database driver.
- */
- public void setDriver(String driver)
- {
- this.driver = driver;
- }
-
- /**
- * Returns the password of the database user.
- *
- * @return the password of the database user.
- */
- public String getPassword()
- {
- return password;
- }
-
- /**
- * Sets the password of the database user.
- *
- * @param password the password of the database user.
- */
- public void setPassword(String password)
- {
- this.password = password;
- }
-
- /**
- * Returns the connect URL to the database.
- *
- * @return the connect URL to the database.
- */
- public String getUrl()
- {
- return url;
- }
-
- /**
- * Sets the connect URL to the database.
- *
- * @param url the connect URL to the database.
- */
- public void setUrl(String url)
- {
- this.url = url;
- }
-
- /**
- * Returns the database user.
- *
- * @return the userId of the database user.
- */
- public String getUser()
- {
- return user;
- }
-
- /**
- * Sets the database user.
- *
- * @param user the userId of the database user.
- */
- public void setUser(String user)
- {
- this.user = user;
- }
-
- /**
- * Returns the name of the project, which is used as prefix for the
- * generated table names and the name of the datadtd.
- *
- * @return the name of the project.
- */
- public String getProjectName()
- {
- return projectName;
- }
-
- /**
- * Sets the name of the project, which is used as prefix for the
- * generated table names and the name of the datadtd.
- *
- * @param project the name of the project.
- */
- public void setProjectName(String projectName)
- {
- this.projectName = projectName;
- }
-}
+package org.apache.torque.mojo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.torque.task.TorqueDataDumpTask;
+
+/**
+ * Reads the content of tables from thh database and stores the data
+ * in XML files.
+ *
+ * @author Raphael Pieroni (rafale_at_codehaus.org)
+ * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
+ *
+ * @goal datadump
+ * @phase generate-sources
+ */
+public class DataDumpMojo extends DataModelTaskMojo
+{
+ /** The context property for the name of the project. */
+ public static final String PROJECT_CONTEXT_PROPERTY
+ = "project";
+
+ // The following three dummies trick the Mojo Description Extractor
+ // into setting the correct default values for
+ // outputDir, reportFile and contextPropertiesPath
+ /**
+ * The directory in which the data files will be created.
+ *
+ * @parameter property="outputDir"
+ * expression="${project.build.directory}/data/torque"
+ */
+ private String dummy;
+
+ /**
+ * The location where the report file will be generated.
+ *
+ * @parameter property="reportFile"
+ * expression="../../torque/report.${project.artifact.artifactId}.data.generation"
+ */
+ private String dummy2;
+
+ /**
+ * The location where the context property file for velocity will be
+ * generated.
+ *
+ * @parameter property="contextPropertiesPath"
+ * expression="${project.build.directory}/torque/context.data.properties"
+ */
+ private String dummy3;
+
+ /**
+ * The fully qualified class name of the database driver.
+ *
+ * @parameter
+ * @required
+ */
+ private String driver = null;
+
+ /**
+ * The connect URL of the database.
+ *
+ * @parameter
+ * @required
+ */
+ private String url = null;
+
+ /**
+ * The user name to connect to the database.
+ *
+ * @parameter
+ * @required
+ */
+ private String user = null;
+
+ /**
+ * The password for the database user.
+ *
+ * @parameter
+ */
+ private String password = null;
+
+ /**
+ * The name of the project, used as a prefix of the names
+ * of the generated files and the name of the datadtd.
+ *
+ * @parameter expression="torque"
+ */
+ private String projectName = null;
+
+ /**
+ * Creates a new SQLMojo object.
+ */
+ public DataDumpMojo()
+ {
+ super(new TorqueDataDumpTask());
+ }
+
+ /**
+ * Returns the path to the control template.
+ *
+ * @return "data/Control.vm"
+ */
+ protected String getControlTemplate()
+ {
+ return "data/dump/Control.vm";
+ }
+
+ /**
+ * Returns the context properties for the Texen task.
+ *
+ * @return The PropertiesConfiguration containing all context properties,
+ * not null.
+ */
+ protected PropertiesConfiguration getMojoContextProperties()
+ {
+ PropertiesConfiguration configuration = new PropertiesConfiguration();
+ configuration.addProperty(PROJECT_CONTEXT_PROPERTY, projectName);
+ return configuration;
+ }
+
+ /**
+ * Configures the Texen task which is wrapped by this mojo.
+ * In this implementation, the context properties, useClasspath,
+ * the output directory, the control template, the schema Fileset,
+ * the target package and the target database are set.
+ *
+ * @throws MojoExecutionException if an error occurs when setting the Tasks
+ * properties.
+ *
+ * @see TexenTaskMojo#configureTask()
+ */
+ protected void configureTask() throws MojoExecutionException
+ {
+ super.configureTask();
+
+ TorqueDataDumpTask task
+ = (TorqueDataDumpTask) super.getGeneratorTask();
+
+ task.setDatabaseDriver(driver);
+
+ task.setDatabaseUrl(url);
+
+ task.setDatabaseUser(user);
+
+ task.setDatabasePassword(password);
+ }
+
+ /**
+ * Returns the fully qualified class name of the database driver.
+ *
+ * @return the fully qualified class name of the database driver.
+ */
+ public String getDriver()
+ {
+ return driver;
+ }
+
+ /**
+ * Sets the fully qualified class name of the database driver.
+ *
+ * @param driver the fully qualified class name of the database driver.
+ */
+ public void setDriver(String driver)
+ {
+ this.driver = driver;
+ }
+
+ /**
+ * Returns the password of the database user.
+ *
+ * @return the password of the database user.
+ */
+ public String getPassword()
+ {
+ return password;
+ }
+
+ /**
+ * Sets the password of the database user.
+ *
+ * @param password the password of the database user.
+ */
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ /**
+ * Returns the connect URL to the database.
+ *
+ * @return the connect URL to the database.
+ */
+ public String getUrl()
+ {
+ return url;
+ }
+
+ /**
+ * Sets the connect URL to the database.
+ *
+ * @param url the connect URL to the database.
+ */
+ public void setUrl(String url)
+ {
+ this.url = url;
+ }
+
+ /**
+ * Returns the database user.
+ *
+ * @return the userId of the database user.
+ */
+ public String getUser()
+ {
+ return user;
+ }
+
+ /**
+ * Sets the database user.
+ *
+ * @param user the userId of the database user.
+ */
+ public void setUser(String user)
+ {
+ this.user = user;
+ }
+
+ /**
+ * Returns the name of the project, which is used as prefix for the
+ * generated table names and the name of the datadtd.
+ *
+ * @return the name of the project.
+ */
+ public String getProjectName()
+ {
+ return projectName;
+ }
+
+ /**
+ * Sets the name of the project, which is used as prefix for the
+ * generated table names and the name of the datadtd.
+ *
+ * @param project the name of the project.
+ */
+ public void setProjectName(String projectName)
+ {
+ this.projectName = projectName;
+ }
+}
Modified: db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataModelTaskMojo.java
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataModelTaskMojo.java?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataModelTaskMojo.java (original)
+++ db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataModelTaskMojo.java Sat Nov 11 14:32:42 2006
@@ -1,415 +1,418 @@
-package org.apache.torque.mojo;
-
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.File;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.torque.task.TorqueDataModelTask;
-
-/**
- * The base class for all mojos wrapping DataModelTasks.
- *
- * @author Raphael Pieroni (rafale_at_codehaus.org)
- * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
- */
-public abstract class DataModelTaskMojo
- extends TexenTaskMojo
-{
- /**
- * The context property for the database.
- */
- public static final String TARGET_DATABASE_CONTEXT_PROPERTY
- = "targetDatabase";
-
- /**
- * The path to the directory where the schema files are located in.
- *
- * @parameter expression="${basedir}/src/main/torque/schema"
- * @required
- */
- private String schemaDir;
-
- /**
- * The schema files which should be included in generation
- * (in ant-style notation).
- *
- * @parameter expression="*schema.xml"
- * @required
- */
- private String schemaIncludes;
-
- /**
- * The schema files which should be excluded in generation
- * (in ant-style notation).
- *
- * @parameter expression="id-table-schema.xml"
- */
- private String schemaExcludes;
-
- /**
- * The database type (e.g. mysql, oracle, ...) for the generated persistence
- * classes,
- *
- * @parameter
- * @required
- */
- private String targetDatabase;
-
- /**
- * The target package for the generated classes.
- *
- * @parameter expression="torque.generated"
- */
- private String targetPackage;
-
- /**
- * The file containing the generation report, relative to
- * <code>outputDir</code>.
- *
- * @required
- */
- private String reportFile;
-
- /**
- * Determines if this task should run only if the schema has changed.
- *
- * @parameter expression="true"
- */
- private boolean runOnlyOnSchemaChange;
-
- /**
- * The path to the properties file containing the mapping
- * sql file -> target database.
- *
- * @parameter expression="${project.build.directory}/torque/sqldbmap.properties"
- */
- private String sqlDbMap;
-
- /**
- * Creates a new TorqueOMMojo object.
- */
- DataModelTaskMojo()
- {
- super(new TorqueDataModelTask());
- }
-
- /**
- * Creates a new TorqueOMMojo object wrapping the passed
- * TorqueDataModelTask.
- *
- * @param torqueDataModelTask the DataModelTask to be wrapped by this Mojo.
- */
- DataModelTaskMojo(TorqueDataModelTask torqueDataModelTask)
- {
- super(torqueDataModelTask);
- }
-
- /**
- * Configures the Texen task which is wrapped by this mojo.
- * In this implementation, the context properties, useClasspath,
- * the output directory, the control template, the schema Fileset,
- * the target package and the target database are set.
- *
- * @throws MojoExecutionException if an error occurs when setting the Tasks
- * properties.
- *
- * @see TexenTaskMojo#configureTask()
- */
- protected void configureTask() throws MojoExecutionException
- {
- super.configureTask();
-
- TorqueDataModelTask task
- = (TorqueDataModelTask) super.getGeneratorTask();
-
- task.setControlTemplate(getControlTemplate());
-
- task.setOutputFile(reportFile);
-
- task.setTargetDatabase(targetDatabase);
-
- task.setTargetPackage(getTargetPackage());
-
- if (sqlDbMap != null)
- {
- task.setSqlDbMap(sqlDbMap);
- }
-
- {
- FileSet fileSet = new FileSet();
- fileSet.setDir(new File(schemaDir));
- fileSet.setIncludes(schemaIncludes);
- fileSet.setExcludes(schemaExcludes);
-
- task.addFileset(fileSet);
- }
- }
-
- /**
- * Returns whether the schema has changed. This is done by comparing
- * the modification date of all schema files to the modification date
- * of the report file.
- *
- * @return whether the schema has changed.
- */
- protected boolean schemaChanged()
- {
- boolean schemaChanged = true;
- File report = new File(super.getOutputDir(), this.reportFile);
- if (report.exists())
- {
- FileSet fileSet = new FileSet();
- fileSet.setDir(new File(schemaDir));
- fileSet.setIncludes(schemaIncludes);
- fileSet.setExcludes(schemaExcludes);
-
- DirectoryScanner directoryScanner
- = fileSet.getDirectoryScanner(getAntProject());
-
- String[] fileNames = directoryScanner.getIncludedFiles();
-
-/* File schemaDirectory = new File(schemaDir);
- FileFilter schemaFileFilter = new FileFilter() {
- public boolean accept(File toCheck)
- {
- String path = toCheck.getAbsolutePath();
- if (schemaExcludes != null
- && !schemaExcludes.trim().equals("")
- && Pattern.matches(schemaExcludes, path))
- {
- return false;
- }
- return Pattern.matches(schemaIncludes, path);
- }
- };
- File[] schemaFiles = schemaDirectory.listFiles(schemaFileFilter);*/
-
- // schema has changed if one of the schema files has a modification
- // Date larger than the report.
- schemaChanged = false;
- for (int i = 0; i < fileNames.length; ++i)
- {
- File file = new File(fileNames[i]);
- if (file.lastModified() > report.lastModified())
- {
- schemaChanged = true;
- break;
- }
- }
- }
-
- return schemaChanged;
- }
-
- /**
- * Returns the directory where the schema files are located.
- *
- * @return the the directory where the schema files are located.
- */
- public String getSchemaDir()
- {
- return schemaDir;
- }
-
- /**
- * Sets the the directory where the schema files are located.
- *
- * @param schemaDir the directory where the schema files are located.
- */
- public void setSchemaDir(String schemaDir)
- {
- this.schemaDir = schemaDir;
- }
-
- /**
- * Returns the target database (e.g. mysql, oracle, ... )
- * for the generated files.
- *
- * @return the target database for the generated files.
- */
- public String getTargetDatabase()
- {
- return targetDatabase;
- }
-
- /**
- * Sets the target database (e.g. mysql, oracle, ... )
- * for the generated files.
- *
- * @param targetDatabase the target database for the generated files.
- */
- public void setTargetDatabase(String targetDatabase)
- {
- this.targetDatabase = targetDatabase;
- }
-
- /**
- * Returns the target package for the generated classes.
- *
- * @return the target package for the generated classes.
- */
- public String getTargetPackage()
- {
- return targetPackage;
- }
-
- /**
- * Sets the target package for the generated classes.
- *
- * param targetPackage the target package for the generated classes.
- */
- public void setTargetPackage(String targetPackage)
- {
- this.targetPackage = targetPackage;
- }
-
- /**
- * Gets the path to the report file. The path is relative to
- * <code>outputDir</code>.
- *
- * @return the path to the report file.
- */
- public String getReportFile()
- {
- return reportFile;
- }
-
- /**
- * Sets the path to the report file. The path is relative to
- * <code>outputDir</code>.
- *
- * @param reportFile the path to the report file.
- */
- public void setReportFile(String reportFile)
- {
- this.reportFile = reportFile;
- }
-
- /**
- * Returns whether this mojo should be executed only if the schema has
- * changed.
- *
- * @return true if the mojo only runs if the schema has changed,
- * false otherwise.
- */
- public boolean isRunOnlyOnSchemaChange()
- {
- return runOnlyOnSchemaChange;
- }
-
- /**
- * Sets whether this mojo should be executed only if the schema has
- * changed.
- *
- * @param runOnlyOnSchemaChange whether the mojo only should run
- * if the schema has changed.
- */
- public void setRunOnlyOnSchemaChange(boolean runOnlyOnSchemaChange)
- {
- this.runOnlyOnSchemaChange = runOnlyOnSchemaChange;
- }
-
- /**
- * Runs the generation for the database layout defined in the schema.xml
- * files.
- *
- * @throws MojoExecutionException If an error occurs during generation.
- *
- * @see TexenTaskMojo#execute()
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public void execute() throws MojoExecutionException
- {
- if (!schemaChanged() && isRunOnlyOnSchemaChange())
- {
- getLog().info("Schema has not changed; skipping generation");
- return;
- }
-
- super.execute();
- }
-
- /**
- * Returns the schema files which are excluded from generation.
- *
- * @return the pattern for the excluded files.
- */
- public String getSchemaExcludes()
- {
- return schemaExcludes;
- }
-
- /**
- * Sets the schema files which are excluded from generation.
- *
- * @param schemaExcludes the pattern for the excluded files.
- */
- public void setSchemaExcludes(String schemaExcludes)
- {
- this.schemaExcludes = schemaExcludes;
- }
-
- /**
- * Returns the schema files which are included in generation.
- *
- * @return the pattern for the included files.
- */
- public String getSchemaIncludes()
- {
- return schemaIncludes;
- }
-
- /**
- * Sets the schema files which are included in generation.
- *
- * @param schemaIncludes the pattern for the included files.
- */
- public void setSchemaIncludes(String schemaIncludes)
- {
- this.schemaIncludes = schemaIncludes;
- }
-
- /**
- * Returns the path to the mapping SQL Files -> database.
- *
- * @return the path to the mapping SQL Files -> database.
- */
- public String getSqlDbMap()
- {
- return sqlDbMap;
- }
-
- /**
- * Sets the path to the mapping SQL Files -> database.
- *
- * @param sqlDbMap the absolute path to the mapping SQL Files -> database.
- */
- public void setSqlDbMap(String sqlDbMap)
- {
- this.sqlDbMap = sqlDbMap;
- }
-
- /**
- * Returns the path to the control template.
- *
- * @return the path to the control template.
- */
- protected abstract String getControlTemplate();
-}
+package org.apache.torque.mojo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.torque.task.TorqueDataModelTask;
+
+/**
+ * The base class for all mojos wrapping DataModelTasks.
+ *
+ * @author Raphael Pieroni (rafale_at_codehaus.org)
+ * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
+ */
+public abstract class DataModelTaskMojo
+ extends TexenTaskMojo
+{
+ /**
+ * The context property for the database.
+ */
+ public static final String TARGET_DATABASE_CONTEXT_PROPERTY
+ = "targetDatabase";
+
+ /**
+ * The path to the directory where the schema files are located in.
+ *
+ * @parameter expression="${basedir}/src/main/torque/schema"
+ * @required
+ */
+ private String schemaDir;
+
+ /**
+ * The schema files which should be included in generation
+ * (in ant-style notation).
+ *
+ * @parameter expression="*schema.xml"
+ * @required
+ */
+ private String schemaIncludes;
+
+ /**
+ * The schema files which should be excluded in generation
+ * (in ant-style notation).
+ *
+ * @parameter expression="id-table-schema.xml"
+ */
+ private String schemaExcludes;
+
+ /**
+ * The database type (e.g. mysql, oracle, ...) for the generated persistence
+ * classes,
+ *
+ * @parameter
+ * @required
+ */
+ private String targetDatabase;
+
+ /**
+ * The target package for the generated classes.
+ *
+ * @parameter expression="torque.generated"
+ */
+ private String targetPackage;
+
+ /**
+ * The file containing the generation report, relative to
+ * <code>outputDir</code>.
+ *
+ * @required
+ */
+ private String reportFile;
+
+ /**
+ * Determines if this task should run only if the schema has changed.
+ *
+ * @parameter expression="true"
+ */
+ private boolean runOnlyOnSchemaChange;
+
+ /**
+ * The path to the properties file containing the mapping
+ * sql file -> target database.
+ *
+ * @parameter expression="${project.build.directory}/torque/sqldbmap.properties"
+ */
+ private String sqlDbMap;
+
+ /**
+ * Creates a new TorqueOMMojo object.
+ */
+ DataModelTaskMojo()
+ {
+ super(new TorqueDataModelTask());
+ }
+
+ /**
+ * Creates a new TorqueOMMojo object wrapping the passed
+ * TorqueDataModelTask.
+ *
+ * @param torqueDataModelTask the DataModelTask to be wrapped by this Mojo.
+ */
+ DataModelTaskMojo(TorqueDataModelTask torqueDataModelTask)
+ {
+ super(torqueDataModelTask);
+ }
+
+ /**
+ * Configures the Texen task which is wrapped by this mojo.
+ * In this implementation, the context properties, useClasspath,
+ * the output directory, the control template, the schema Fileset,
+ * the target package and the target database are set.
+ *
+ * @throws MojoExecutionException if an error occurs when setting the Tasks
+ * properties.
+ *
+ * @see TexenTaskMojo#configureTask()
+ */
+ protected void configureTask() throws MojoExecutionException
+ {
+ super.configureTask();
+
+ TorqueDataModelTask task
+ = (TorqueDataModelTask) super.getGeneratorTask();
+
+ task.setControlTemplate(getControlTemplate());
+
+ task.setOutputFile(reportFile);
+
+ task.setTargetDatabase(targetDatabase);
+
+ task.setTargetPackage(getTargetPackage());
+
+ if (sqlDbMap != null)
+ {
+ task.setSqlDbMap(sqlDbMap);
+ }
+
+ {
+ FileSet fileSet = new FileSet();
+ fileSet.setDir(new File(schemaDir));
+ fileSet.setIncludes(schemaIncludes);
+ fileSet.setExcludes(schemaExcludes);
+
+ task.addFileset(fileSet);
+ }
+ }
+
+ /**
+ * Returns whether the schema has changed. This is done by comparing
+ * the modification date of all schema files to the modification date
+ * of the report file.
+ *
+ * @return whether the schema has changed.
+ */
+ protected boolean schemaChanged()
+ {
+ boolean schemaChanged = true;
+ File report = new File(super.getOutputDir(), this.reportFile);
+ if (report.exists())
+ {
+ FileSet fileSet = new FileSet();
+ fileSet.setDir(new File(schemaDir));
+ fileSet.setIncludes(schemaIncludes);
+ fileSet.setExcludes(schemaExcludes);
+
+ DirectoryScanner directoryScanner
+ = fileSet.getDirectoryScanner(getAntProject());
+
+ String[] fileNames = directoryScanner.getIncludedFiles();
+
+/* File schemaDirectory = new File(schemaDir);
+ FileFilter schemaFileFilter = new FileFilter() {
+ public boolean accept(File toCheck)
+ {
+ String path = toCheck.getAbsolutePath();
+ if (schemaExcludes != null
+ && !schemaExcludes.trim().equals("")
+ && Pattern.matches(schemaExcludes, path))
+ {
+ return false;
+ }
+ return Pattern.matches(schemaIncludes, path);
+ }
+ };
+ File[] schemaFiles = schemaDirectory.listFiles(schemaFileFilter);*/
+
+ // schema has changed if one of the schema files has a modification
+ // Date larger than the report.
+ schemaChanged = false;
+ for (int i = 0; i < fileNames.length; ++i)
+ {
+ File file = new File(fileNames[i]);
+ if (file.lastModified() > report.lastModified())
+ {
+ schemaChanged = true;
+ break;
+ }
+ }
+ }
+
+ return schemaChanged;
+ }
+
+ /**
+ * Returns the directory where the schema files are located.
+ *
+ * @return the the directory where the schema files are located.
+ */
+ public String getSchemaDir()
+ {
+ return schemaDir;
+ }
+
+ /**
+ * Sets the the directory where the schema files are located.
+ *
+ * @param schemaDir the directory where the schema files are located.
+ */
+ public void setSchemaDir(String schemaDir)
+ {
+ this.schemaDir = schemaDir;
+ }
+
+ /**
+ * Returns the target database (e.g. mysql, oracle, ... )
+ * for the generated files.
+ *
+ * @return the target database for the generated files.
+ */
+ public String getTargetDatabase()
+ {
+ return targetDatabase;
+ }
+
+ /**
+ * Sets the target database (e.g. mysql, oracle, ... )
+ * for the generated files.
+ *
+ * @param targetDatabase the target database for the generated files.
+ */
+ public void setTargetDatabase(String targetDatabase)
+ {
+ this.targetDatabase = targetDatabase;
+ }
+
+ /**
+ * Returns the target package for the generated classes.
+ *
+ * @return the target package for the generated classes.
+ */
+ public String getTargetPackage()
+ {
+ return targetPackage;
+ }
+
+ /**
+ * Sets the target package for the generated classes.
+ *
+ * param targetPackage the target package for the generated classes.
+ */
+ public void setTargetPackage(String targetPackage)
+ {
+ this.targetPackage = targetPackage;
+ }
+
+ /**
+ * Gets the path to the report file. The path is relative to
+ * <code>outputDir</code>.
+ *
+ * @return the path to the report file.
+ */
+ public String getReportFile()
+ {
+ return reportFile;
+ }
+
+ /**
+ * Sets the path to the report file. The path is relative to
+ * <code>outputDir</code>.
+ *
+ * @param reportFile the path to the report file.
+ */
+ public void setReportFile(String reportFile)
+ {
+ this.reportFile = reportFile;
+ }
+
+ /**
+ * Returns whether this mojo should be executed only if the schema has
+ * changed.
+ *
+ * @return true if the mojo only runs if the schema has changed,
+ * false otherwise.
+ */
+ public boolean isRunOnlyOnSchemaChange()
+ {
+ return runOnlyOnSchemaChange;
+ }
+
+ /**
+ * Sets whether this mojo should be executed only if the schema has
+ * changed.
+ *
+ * @param runOnlyOnSchemaChange whether the mojo only should run
+ * if the schema has changed.
+ */
+ public void setRunOnlyOnSchemaChange(boolean runOnlyOnSchemaChange)
+ {
+ this.runOnlyOnSchemaChange = runOnlyOnSchemaChange;
+ }
+
+ /**
+ * Runs the generation for the database layout defined in the schema.xml
+ * files.
+ *
+ * @throws MojoExecutionException If an error occurs during generation.
+ *
+ * @see TexenTaskMojo#execute()
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
+ public void execute() throws MojoExecutionException
+ {
+ if (!schemaChanged() && isRunOnlyOnSchemaChange())
+ {
+ getLog().info("Schema has not changed; skipping generation");
+ return;
+ }
+
+ super.execute();
+ }
+
+ /**
+ * Returns the schema files which are excluded from generation.
+ *
+ * @return the pattern for the excluded files.
+ */
+ public String getSchemaExcludes()
+ {
+ return schemaExcludes;
+ }
+
+ /**
+ * Sets the schema files which are excluded from generation.
+ *
+ * @param schemaExcludes the pattern for the excluded files.
+ */
+ public void setSchemaExcludes(String schemaExcludes)
+ {
+ this.schemaExcludes = schemaExcludes;
+ }
+
+ /**
+ * Returns the schema files which are included in generation.
+ *
+ * @return the pattern for the included files.
+ */
+ public String getSchemaIncludes()
+ {
+ return schemaIncludes;
+ }
+
+ /**
+ * Sets the schema files which are included in generation.
+ *
+ * @param schemaIncludes the pattern for the included files.
+ */
+ public void setSchemaIncludes(String schemaIncludes)
+ {
+ this.schemaIncludes = schemaIncludes;
+ }
+
+ /**
+ * Returns the path to the mapping SQL Files -> database.
+ *
+ * @return the path to the mapping SQL Files -> database.
+ */
+ public String getSqlDbMap()
+ {
+ return sqlDbMap;
+ }
+
+ /**
+ * Sets the path to the mapping SQL Files -> database.
+ *
+ * @param sqlDbMap the absolute path to the mapping SQL Files -> database.
+ */
+ public void setSqlDbMap(String sqlDbMap)
+ {
+ this.sqlDbMap = sqlDbMap;
+ }
+
+ /**
+ * Returns the path to the control template.
+ *
+ * @return the path to the control template.
+ */
+ protected abstract String getControlTemplate();
+}
Modified: db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataSqlMojo.java
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataSqlMojo.java?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataSqlMojo.java (original)
+++ db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DataSqlMojo.java Sat Nov 11 14:32:42 2006
@@ -1,90 +1,93 @@
-package org.apache.torque.mojo;
-
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.torque.task.TorqueSQLTask;
-
-/**
- * Generates SQL for populating the database from data.xml files.
- *
- * @author Raphael Pieroni (rafale_at_codehaus.org)
- * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
- *
- * @goal datasql
- * @phase generate-sources
- */
-public class DataSqlMojo extends DataModelTaskMojo
-{
- // The following three dummies trick the Mojo Description Extractor
- // into setting the correct default values for
- // outputDir, reportFile and contextPropertiesPath
- /**
- * The directory in which the sql will be generated.
- *
- * @parameter property="outputDir"
- * expression="${project.build.directory}/generated-sql/torque"
- */
- private String dummy;
-
- /**
- * The location where the report file will be generated.
- *
- * @parameter property="reportFile"
- * expression="../../torque/report.${project.artifact.artifactId}.datasql.generation"
- */
- private String dummy2;
-
- /**
- * The location where the context property file for velocity will be
- * generated.
- *
- * @parameter property="contextPropertiesPath"
- * expression="${project.build.directory}/torque/context.datasql.properties"
- */
- private String dummy3;
-
- /**
- * Creates a new SQLMojo object.
- */
- public DataSqlMojo()
- {
- super(new TorqueSQLTask());
- }
-
- /**
- * Returns the context properties for the Texen task.
- *
- * @return The PropertiesConfiguration containing all context properties,
- * not null.
- */
- protected PropertiesConfiguration getMojoContextProperties()
- {
- PropertiesConfiguration configuration = new PropertiesConfiguration();
- return configuration;
- }
-
- /**
- * Returns the path to the control template.
- *
- * @return "sql/load/Control.vm"
- */
- protected String getControlTemplate()
- {
- return "sql/load/Control.vm";
- }
-}
+package org.apache.torque.mojo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.torque.task.TorqueSQLTask;
+
+/**
+ * Generates SQL for populating the database from data.xml files.
+ *
+ * @author Raphael Pieroni (rafale_at_codehaus.org)
+ * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
+ *
+ * @goal datasql
+ * @phase generate-sources
+ */
+public class DataSqlMojo extends DataModelTaskMojo
+{
+ // The following three dummies trick the Mojo Description Extractor
+ // into setting the correct default values for
+ // outputDir, reportFile and contextPropertiesPath
+ /**
+ * The directory in which the sql will be generated.
+ *
+ * @parameter property="outputDir"
+ * expression="${project.build.directory}/generated-sql/torque"
+ */
+ private String dummy;
+
+ /**
+ * The location where the report file will be generated.
+ *
+ * @parameter property="reportFile"
+ * expression="../../torque/report.${project.artifact.artifactId}.datasql.generation"
+ */
+ private String dummy2;
+
+ /**
+ * The location where the context property file for velocity will be
+ * generated.
+ *
+ * @parameter property="contextPropertiesPath"
+ * expression="${project.build.directory}/torque/context.datasql.properties"
+ */
+ private String dummy3;
+
+ /**
+ * Creates a new SQLMojo object.
+ */
+ public DataSqlMojo()
+ {
+ super(new TorqueSQLTask());
+ }
+
+ /**
+ * Returns the context properties for the Texen task.
+ *
+ * @return The PropertiesConfiguration containing all context properties,
+ * not null.
+ */
+ protected PropertiesConfiguration getMojoContextProperties()
+ {
+ PropertiesConfiguration configuration = new PropertiesConfiguration();
+ return configuration;
+ }
+
+ /**
+ * Returns the path to the control template.
+ *
+ * @return "sql/load/Control.vm"
+ */
+ protected String getControlTemplate()
+ {
+ return "sql/load/Control.vm";
+ }
+}
Modified: db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DocumentationMojo.java
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DocumentationMojo.java?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DocumentationMojo.java (original)
+++ db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/DocumentationMojo.java Sat Nov 11 14:32:42 2006
@@ -1,125 +1,128 @@
-package org.apache.torque.mojo;
-
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.torque.task.TorqueSQLTask;
-
-/**
- * Creates html or anakia documentation for the data model from the
- * schema.xml files.
- *
- * @author Raphael Pieroni (rafale_at_codehaus.org)
- * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
- *
- * @goal documentation
- * @phase generate-sources
- */
-public class DocumentationMojo extends DataModelTaskMojo
-{
- /** The context property for the output format. */
- public static final String OUTPUT_FORMAT_CONTEXT_PROPERTY
- = "outputFormat";
-
- // The following three dummies trick the Mojo Description Extractor
- // into setting the correct default values for
- // outputDir, reportFile and contextPropertiesPath
- /**
- * The directory in which the documentation will be generated
- *
- * @parameter property="outputDir"
- * expression="${project.build.directory}/generated-docs/torque"
- */
- private String dummy;
-
- /**
- * The location where the report file will be generated.
- *
- * @parameter property="reportFile"
- * expression="../../torque/report.${project.artifact.artifactId}.doc.generation"
- */
- private String dummy2;
-
- /**
- * The location where the context property file for velocity will be
- * generated.
- *
- * @parameter property="contextPropertiesPath"
- * expression="${project.build.directory}/torque/context.doc.properties"
- */
- private String dummy3;
-
- /**
- * The format of the generated documentation. Can be either html or anakia.
- *
- * @parameter expression="html"
- */
- private String outputFormat;
-
- /**
- * Creates a new SQLMojo object.
- */
- public DocumentationMojo()
- {
- super(new TorqueSQLTask());
- }
-
- /**
- * Sets the output format of the documentation (html or anakia)
- *
- * @param outputFormat the output format of the documentation.
- */
- public void setOutputFormat(String outputFormat)
- {
- this.outputFormat = outputFormat;
- }
-
- /**
- * Returns the output format of the documentation (html or anakia)
- *
- * @return the output format of the documentation.
- */
- public String getOutputFormat()
- {
- return outputFormat;
- }
-
- /**
- * Returns the context properties for the Texen task.
- *
- * @return The PropertiesConfiguration containing all context properties,
- * not null.
- */
- protected PropertiesConfiguration getMojoContextProperties()
- {
- PropertiesConfiguration configuration = new PropertiesConfiguration();
- configuration.addProperty(
- OUTPUT_FORMAT_CONTEXT_PROPERTY,
- getOutputFormat());
- return configuration;
- }
-
- /**
- * Returns the path to the control template.
- *
- * @return "doc/Control.vm"
- */
- protected String getControlTemplate()
- {
- return "doc/Control.vm";
- }
-}
+package org.apache.torque.mojo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.torque.task.TorqueSQLTask;
+
+/**
+ * Creates html or anakia documentation for the data model from the
+ * schema.xml files.
+ *
+ * @author Raphael Pieroni (rafale_at_codehaus.org)
+ * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
+ *
+ * @goal documentation
+ * @phase generate-sources
+ */
+public class DocumentationMojo extends DataModelTaskMojo
+{
+ /** The context property for the output format. */
+ public static final String OUTPUT_FORMAT_CONTEXT_PROPERTY
+ = "outputFormat";
+
+ // The following three dummies trick the Mojo Description Extractor
+ // into setting the correct default values for
+ // outputDir, reportFile and contextPropertiesPath
+ /**
+ * The directory in which the documentation will be generated
+ *
+ * @parameter property="outputDir"
+ * expression="${project.build.directory}/generated-docs/torque"
+ */
+ private String dummy;
+
+ /**
+ * The location where the report file will be generated.
+ *
+ * @parameter property="reportFile"
+ * expression="../../torque/report.${project.artifact.artifactId}.doc.generation"
+ */
+ private String dummy2;
+
+ /**
+ * The location where the context property file for velocity will be
+ * generated.
+ *
+ * @parameter property="contextPropertiesPath"
+ * expression="${project.build.directory}/torque/context.doc.properties"
+ */
+ private String dummy3;
+
+ /**
+ * The format of the generated documentation. Can be either html or anakia.
+ *
+ * @parameter expression="html"
+ */
+ private String outputFormat;
+
+ /**
+ * Creates a new SQLMojo object.
+ */
+ public DocumentationMojo()
+ {
+ super(new TorqueSQLTask());
+ }
+
+ /**
+ * Sets the output format of the documentation (html or anakia)
+ *
+ * @param outputFormat the output format of the documentation.
+ */
+ public void setOutputFormat(String outputFormat)
+ {
+ this.outputFormat = outputFormat;
+ }
+
+ /**
+ * Returns the output format of the documentation (html or anakia)
+ *
+ * @return the output format of the documentation.
+ */
+ public String getOutputFormat()
+ {
+ return outputFormat;
+ }
+
+ /**
+ * Returns the context properties for the Texen task.
+ *
+ * @return The PropertiesConfiguration containing all context properties,
+ * not null.
+ */
+ protected PropertiesConfiguration getMojoContextProperties()
+ {
+ PropertiesConfiguration configuration = new PropertiesConfiguration();
+ configuration.addProperty(
+ OUTPUT_FORMAT_CONTEXT_PROPERTY,
+ getOutputFormat());
+ return configuration;
+ }
+
+ /**
+ * Returns the path to the control template.
+ *
+ * @return "doc/Control.vm"
+ */
+ protected String getControlTemplate()
+ {
+ return "doc/Control.vm";
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org