Ahh, very good points! The ability to run multiple middlegen(s) from a smaller properties file is definately better than behomoth maven.xml files and the plugin would be definately is easier for users just getting started. If something like MEVENIDE gets up to speed (an Eclipse plugin for Maven), maven plugins like this would be even more valuable.
-----Original Message-----
Sent: Wednesday, October 13, 2004 3:27 AM
Subject: RE: [Middlegen-user] Middlegen Maven Plugin
Think I see your point, the Ant task will still be the main (and most
up-to-date) way to run Middlegen. In fact, the Maven plugin is simply
calling the Ant task. If you want to keep full control of your build
goals, you should probably keep your current setup.
- Dependencies: You only need to specify a dependency on the Middlegen
...
<dependency>
<groupId>middlegen</groupId>
<artifactId>maven-middlegen-plugin</artifactId>
<version>2.1</version>
<type>plugin</type>
</dependency>
...
The plugin will download the files it needs itself (Middlegen
jar files,
velocity etc.).
- Easier to run Middlegen several times on different
databases/options.
The Maven plugin has support for running Middlegen up to 50
times in one
maven.middlegen.run.0=true
maven.middlegen.0.database.url=jdbc:hsqldb:${maven.src.dir}/hs
qldb/airline
maven.middlegen.run.1=true
maven.middlegen.1.database.url=jdbc:mysql://localhost/test
- No need to maintain a big maven.xml file with goals :)
The main reason I added in the plugin was to make Middlegen
easier to use
for new users. We've had some complaints about the complexity of
configuring and running Middlegen..
.eivind
Post by Darren HartfordHi Eivand,all,
All of my J2EE projects are built with the Maven framework,
but to-date I've only used the ANT-based tasks for build
instructions (i.e. use existing ANT configurations in Maven).
Post by Darren HartfordYou've peaked my interest, but what would be gained for
users, like me, by using the Maven Middlegen plugin?
Post by Darren Hartford==========
<goal name="middlegen:ejb">
<taskdef name="middlegen" classname="middlegen.MiddlegenTask">
<classpath>
<path refid="maven.dependency.classpath"/>
</classpath>
</taskdef>
<middlegen
appname="${pom.artifactId}"
prefsdir="${basedir}"
gui="false"
databaseurl="jdbc:databaseblah"
driver="com.myJDBCDriver"
username="user"
password="password"
datasourceJNDIName="java:/JNDI-DS"
initialContextFactory="org.jnp.interfaces.NamingContextFactory"
Post by Darren HartfordproviderURL="localhost:1099"
<!--
<table name="ATABLELISTINGIFYOUWANT"
singular="Table" plural="Tables"/>
Post by Darren Hartford-->
<cmp20
destination="${basedir}/generated/middlegen"
mergedir="${basedir}/src/conf/middlegen"
package="${pom.package}.domain.ejb"
interfacepackage="${pom.package}.domain.interfaces"
Post by Darren Hartfordpkclass="false"
dataobject="false"
valueobject="true"
viewtype="local"
readonly="false"
fkcmp="true"
guid="false"
sessionfacade="false"
<jboss/>
</cmp20>
</middlegen>
<attainGoal name="xdoclet:middlegen:ejb"/>
</goal>
=========
I know some people live and breath the maven.properties and
project.properties files, but I personally prefer keeping
with the ANT-based goal/task kind of configuration, as it is
easy to find examples of ANT Tasks that can be easily
converted to Maven goals without the need of plugins nor in
waiting for Maven plugins to be kept up-to-date with their
related project (a fault I have come across in a couple of
project/plugins outside of middlegen).
Post by Darren HartfordSome people will definately enjoy the plugin, but in
keeping with open-source spirit, offering other solution(s)
that already exists as well!