From: Karl B. <ka...@us...> - 2004-09-20 02:04:17
|
karlb8 04/09/19 19:04:10 Added: middlegen project.xml maven.xml plugin.jelly .cvsignore project.properties Log: Initial commit of maven middlegen plugin Revision Changes Path 1.1 maven-plugins/middlegen/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1"?> <project> <extend>${basedir}/../plugin-project.xml</extend> <!--pomVersion is in parent --> <id>maven-middlegen-plugin</id> <name>Middlegen Plugin</name> <!-- groupId is in parent --> <currentVersion>1.0</currentVersion> <!-- organization is in parent --> <inceptionYear>2004</inceptionYear> <!-- package, logo are in parent. --> <description>Middlegen Plugin for Maven</description> <shortDescription>Middlegen Plugin for Maven</shortDescription> <!-- issue tracking url, siteAddress are in parent --> <siteDirectory>/home/groups/m/ma/maven-plugins/htdocs/middlegen/</siteDirectory> <distributionDirectory>/home/groups/m/ma/maven-plugins/htdocs/middlegen/distributions/</distributionDirectory> <repository> <connection>scm:cvs:pserver:ano...@cv...:/cvsroot/maven-plugins:maven-plugins/middlegen</connection> <url>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/maven-plugins/maven-plugins/middlegen/</url> </repository> <versions> </versions> <branches> </branches> <!-- mailingLists are in parent --> <developers> <developer> <name>Karl Baum</name> <id>kbaum</id> <email>kb...@ta...</email> <organization>Tallan Inc.</organization> <roles> <role>Architect</role> </roles> </developer> </developers> <dependencies> <dependency> <groupId>middlegen</groupId> <artifactId>middlegen-hibernate-plugin</artifactId> <version>2.0-vo</version> </dependency> <dependency> <groupId>middlegen</groupId> <artifactId>middlegen</artifactId> <version>2.0-vo</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.0</version> <url>http://jakarta.apache.org/commons/collections.html</url> </dependency> <dependency> <groupId>hibernate</groupId> <artifactId>hibernate-tools</artifactId> <version>2.1.2</version> <url>http://jakarta.apache.org/commons/collections.html</url> </dependency> <dependency> <groupId>velocity</groupId> <artifactId>velocity</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.7</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.8</version> </dependency> <dependency> <groupId>jdom</groupId> <artifactId>jdom</artifactId> <version>0.7</version> <url>http://www.jdom.org</url> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.0</version> <url>http://jakarta.apache.org/commons/</url> </dependency> </dependencies> <build> <nagEmailAddress>tur...@ja...</nagEmailAddress> <sourceDirectory>src/java</sourceDirectory> <unitTestSourceDirectory>src/test</unitTestSourceDirectory> <integrationUnitTestSourceDirectory/> <aspectSourceDirectory></aspectSourceDirectory> <!-- Unit test classes --> <unitTest> <includes> <include>**/*Test.java</include> </includes> </unitTest> <!-- J A R R E S O U R C E S --> <!-- Resources that are packaged up inside the JAR file --> <resources> </resources> <jars> </jars> </build> </project> 1.1 maven-plugins/middlegen/maven.xml Index: maven.xml =================================================================== <project default="plugin" xmlns:j="jelly:core" xmlns:m="maven"> <goal name="plugin"> <j:if test="${sourcesPresent == 'true'}"> <attainGoal name="java:compile"/> <attainGoal name="test:test"/> </j:if> <property name="assemblyDir" value="target/assemblyDir"/> <mkdir dir="${assemblyDir}"/> <copy todir="${assemblyDir}"> <fileset dir="."> <exclude name="target/**"/> <exclude name="src/**"/> <exclude name="maven.xml"/> <exclude name="maven.log"/> </fileset> </copy> <j:if test="${sourcesPresent == 'true'}"> <copy todir="${assemblyDir}"> <fileset dir="target/classes"/> </copy> </j:if> <jar jarfile="${maven.build.dir}/${maven.final.name}.jar"> <fileset dir="${assemblyDir}"/> </jar> <copy file="${maven.build.dir}/${maven.final.name}.jar" todir="${maven.repo.local}/maven/jars" /> </goal> <goal name="plugin:install" prereqs="plugin" description="Install the plugin in Maven's plugins dir"> <copy file="${maven.build.dir}/${maven.final.name}.jar" todir="${maven.home}/plugins" /> </goal> <goal name="plugin:deploy" prereqs="plugin" description="Install an unpacked version of the plugin"> <mkdir dir="${maven.home}/plugins/${maven.final.name}"/> <unzip src="${maven.build.dir}/${maven.final.name}.jar" dest="${maven.home}/plugins/${maven.final.name}" /> </goal> <goal name="plugin:undeploy" description="Delete the deployed version of the plugin"> <delete dir="${maven.home}/plugins/${maven.final.name}"/> </goal> <goal name="plugin:uninstall" description="Delete all versions of the plugin"> <attainGoal name="plugin:undeploy"/> <delete> <fileset dir="${maven.home}/plugins/" includes="${maven.final.name}.jar"/> </delete> </goal> </project> 1.1 maven-plugins/middlegen/plugin.jelly Index: plugin.jelly =================================================================== <?xml version="1.0"?> <project xmlns:ant="jelly:ant" xmlns:x="jelly:xml" xmlns:j="jelly:core" xmlns:util="jelly:util"> <goal name="middlegen:hibernate"> <taskdef name="middlegen" classname="middlegen.MiddlegenTask"> <classpath> <pathelement path="${plugin.getDependencyPath('middlegen-hibernate-plugin')}"/> <pathelement path="${plugin.getDependencyPath('middlegen')}"/> <pathelement path="${plugin.getDependencyPath('commons-collections')}"/> <pathelement path="${plugin.getDependencyPath('velocity')}"/> <pathelement path="${plugin.getDependencyPath('junit')}"/> <pathelement path="${plugin.getDependencyPath('log4j')}"/> <path refid="maven.dependency.classpath" /> </classpath> </taskdef> <ant:middlegen appname="${middlegen.appname}" prefsdir="${middlegen.prefsdir}" gui="${middlegen.gui}" databaseurl="${middlegen.databaseurl}" driver="${middlegen.driver}" username="${middlegen.username}" password="${middlegen.password}" > <util:tokenize var="tables" delim=" ">${middlegen.tables}</util:tokenize> <j:forEach var="table" items="${tables}"> <echo>adding table element ${table}</echo> <table name="${table}"/> </j:forEach> <echo>destination: ${middlegen.hibernate.destination}</echo> <echo>package: ${middlegen.hibernate.package}</echo> <echo>java type mapper: ${middlegen.hibernate.javaTypeMapper}</echo> <ant:hibernate destination="${middlegen.hibernate.destination}" package="${middlegen.hibernate.package}" /> </ant:middlegen> </goal> <goal name="middlegen:hbm2java"> <echo>generating java files</echo> <taskdef name="hbm2java" classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask" > <classpath> <pathelement path="${plugin.getDependencyPath('hibernate:hibernate-tools')}"/> <pathelement path="${plugin.getDependencyPath('jdom')}"/> <pathelement path="${plugin.getDependencyPath('commons-collections')}"/> <pathelement path="${plugin.getDependencyPath('commons-lang')}"/> <path refid="maven.dependency.classpath" /> </classpath> </taskdef> <hbm2java output="${pom.build.sourceDirectory}"> <fileset dir="${pom.build.sourceDirectory}"> <include name="**/*.hbm.xml"/> </fileset> </hbm2java> </goal> </project> 1.1 maven-plugins/middlegen/.cvsignore Index: .cvsignore =================================================================== target 1.1 maven-plugins/middlegen/project.properties Index: project.properties =================================================================== maven.license.licenseFile=${basedir}/../LICENSE.txt # WebSite definition maven.xdoc.version=${pom.currentVersion} maven.xdoc.date=left maven.ui.body.background=white maven.ui.body.foreground=black maven.ui.banner.background=white #middlegen defaults to be overriden by users middlegen.appname=fooAppname middlegen.prefsdir=${pom.build.sourceDirectory} middlegen.gui=false middlegen.databaseurl=jdbc:vendor:someDatabase://servername:1433;DatabaseName=exampleDatabaseSchema middlegen.driver=com.someCompany.someDriver middlegen.username=sa middlegen.password= #for specifying a subset of tables in the database middlegen.tables= #middlegen hibernate defaults middlegen.hibernate.destination=${pom.build.sourceDirectory} middlegen.hiernate.package=${pom.package} middlegen.hibernate.javaTypeMapper=middlegen.plugins.hibernate.HibernateJavaTypeMapper |