Sure. Here is my project.xml file, my project.properties file and my
maven xml file {attached.}
My project structure is as follows:
project.properties
project.xml
maven.xml
src/
java/ {my custom java source code}
test/ {junit/cactus test java source files}
mda/ {my MagicDraw XMI file is in here}
sql/ {some dummy-data sql scripts are here}
target/
java/ {andromda generated java files}
classes/{compiled classes}
webapp/ {generated web application}
There are some other folders but that the basics. The war file gets
dropped into target too. Run maven -o eclipse to generate your eclipse
project and classpath files and then open the project in eclipse.
-Tim
On Fri, 2005-04-15 at 14:45 -0500, Sebastien Arbogast wrote:
> On 4/15/05, Tim Dysinger <[EMAIL PROTECTED]> wrote:
> > MDA is not a simple subject. Learning new tools is never easy either.
> > Having said that, I don't consider AndroMDA the equivalent to DNA
> > manipulation research or even rocket science for that matter. It's just
> > not that hard. What you are finding difficult, is the Maven setup. The
> > AndroMDA part is dirt simple. You can run AndroMDA with Ant if you find
> > it easier.
>
> Yeah maybe you're right about maven, but this is one of my constraints
> : I prefer working with Maven instead of ant...
>
> > My application is setup as a Maven/AndroMDA WAR-only project. It took
> > me a couple of hours to set this up from scratch. One maven.xml, one
> > project.xml and a project.properties file - nice and simple.
>
> Would it be possible for you to show me those configuration files.
> Maybe it would be less difficult than starting from andromdapp demo
> application.
>
> > I think you have to setup a datasource with the way AndroMDA generates
> > the hibernate code. DataSources are the standard setup for J2EE and you
> > can set one up in Tomcat using the administration UI in about 30
> > seconds.
>
> Another constraint : I can't do that because my HSQL-DB server is run
> inside my web application to make its deployment simpler. I don't want
> users to be forced to setup any database of datasource. I managed to
> do this thanks to Cocoon and Avalon, and the only thing I have to do
> with AndroMDA is preventing it from overwriting those parameter
> through Hibernate configuration file.
>
> > It's a work in process and a FREE one a that.
>
> "FREE one a that" ? That is ? Is it going to be available soon ?
>
<project default="install" xmlns:ant="jelly:ant" xmlns:maven="jelly:maven"
xmlns:j="jelly:core" xmlns:util="jelly:util">
<ant:property environment="env"/>
<preGoal name="clean">
<ant:delete>
<ant:fileset dir="${basedir}">
<ant:include name="**/*.log*"/>
<ant:include name="**/*.exc*"/>
</ant:fileset>
</ant:delete>
</preGoal>
<!-- mda -->
<goal name="mda">
<attainGoal name="andromda:run"/>
</goal>
<!-- java -->
<preGoal name="java:compile">
<ant:path id="mda.java.src" location="${maven.build.dir}/java"/>
<maven:addPath id="maven.compile.src.set" refid="mda.java.src"/>
</preGoal>
<goal name="install" prereqs="mda, jar:install, war:install, ddl" />
<goal name="deploy" prereqs="undeploy,war">
<attainGoal name="jboss:deploy-warfile" />
</goal>
<goal name="undeploy">
<attainGoal name="jboss:undeploy-warfile" />
</goal>
<!-- db -->
<goal name="ddl">
<ant:path id="schema.classpath">
<ant:path refid="maven.dependency.classpath"/>
<ant:path location="${maven.build.dir}/classes"/>
</ant:path>
<ant:mkdir dir="${maven.build.dir}/sql"/>
<ant:fileset id="hibernate.mapping.files" dir="${maven.build.dir}/java">
<ant:include name="**/*.hbm.xml"/>
</ant:fileset>
<ant:pathconvert refid="hibernate.mapping.files"
property="hibernate.mappings" pathsep=" "/>
<ant:java classname="net.sf.hibernate.tool.hbm2ddl.SchemaExport"
fork="true">
<ant:arg value="--output=${maven.build.dir}/sql/create.sql"/>
<ant:arg value="--text"/>
<ant:arg value="--quiet"/>
<ant:arg value="--delimiter=;"/>
<ant:arg value="--format"/>
<ant:arg line="${hibernate.mappings}"/>
<ant:jvmarg
value="-Dhibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect"/>
<ant:classpath refid="schema.classpath" />
</ant:java>
<ant:copy file="${maven.build.dir}/sql/create.sql"
tofile="${maven.build.dir}/sql/recreate.sql"/>
<ant:replaceregexp file="${maven.build.dir}/sql/create.sql"
match="^(alter table .* drop constraint|drop table|drop sequence)"
replace="-- SKIP \1" flags="i" byline="true"/>
<ant:java classname="net.sf.hibernate.tool.hbm2ddl.SchemaExport"
fork="true">
<ant:arg value="--output=${maven.build.dir}/sql/drop.sql"/>
<ant:arg value="--text"/>
<ant:arg value="--quiet"/>
<ant:arg value="--drop"/>
<ant:arg value="--delimiter=;"/>
<ant:arg value="--format"/>
<ant:arg line="${hibernate.mappings}"/>
<ant:jvmarg
value="-Dhibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect"/>
<ant:classpath refid="schema.classpath" />
</ant:java>
</goal>
<goal name="create">
<j:set var="script" value="${maven.build.dir}/sql/create.sql"/>
<attainGoal name="exec"/>
</goal>
<goal name="data">
<j:set var="script" value="${maven.src.dir}/sql/data.sql"/>
<attainGoal name="exec"/>
</goal>
<goal name="recreate">
<j:set var="script" value="${maven.build.dir}/sql/recreate.sql"/>
<attainGoal name="exec"/>
</goal>
<goal name="drop">
<j:set var="script" value="${maven.build.dir}/sql/drop.sql"/>
<attainGoal name="exec"/>
</goal>
<goal name="exec">
<j:if test="${script != null}">
<util:file var="scriptFile" name="${script}"/>
<j:if test="${scriptFile.exists()}">
<ant:sql driver="org.postgresql.Driver" src="${scriptFile}"
url="jdbc:postgresql://localhost/dbutil" userid="sa"
password="" >
<ant:classpath>
<ant:pathelement
location="${maven.repo}/server/default/lib/hsqldb.jar"/>
</ant:classpath>
</ant:sql>
</j:if>
</j:if>
</goal>
</project># Maven Properties
maven.repo.remote=http://www.ibiblio.org/maven,http://team.andromda.org/maven,http://dev.supplychainge.com/maven
# AndroMDA MDA Plugin Properties
andromda=3.0-RC2-SNAPSHOT
maven.andromda.model.uri=file:${maven.src.dir}/mda/model.xmi
# War Plugin Properties
maven.war.webapp.dir=${maven.build.dir}/webapp
# Eclipse Plugin Properties
maven.eclipse.classpath.include=target/java
<?xml version="1.0" encoding="UTF-8"?>
<project>
<pomVersion>3</pomVersion>
<id>dbutil</id>
<groupId>supplychainge</groupId>
<name>SupplyChainge Database Utilities</name>
<currentVersion>1.0</currentVersion>
<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org/</url>
<logo>http://maven.apache.org/images/jakarta-logo-blue.gif</logo>
</organization>
<inceptionYear>2005</inceptionYear>
<package>com.supplychainge.dbutil</package>
<logo>http://maven.apache.org/images/maven.jpg</logo>
<description>A collection of example projects showing how to use maven in
different situations</description>
<shortDescription>How to use maven in different
situations</shortDescription>
<url>http://maven.apache.org/reference/plugins/examples/</url>
<issueTrackingUrl>
http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
<siteAddress>jakarta.apache.org</siteAddress>
<siteDirectory>
/www/maven.apache.org/reference/plugins/examples/</siteDirectory>
<distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory>
<repository>
<connection>
scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:maven-plugins/examples</connection>
<url>http://cvs.apache.org/viewcvs/maven-plugins/examples/</url>
</repository>
<mailingLists/>
<developers></developers>
<dependencies>
<!-- core -->
<dependency>
<id>commons-logging</id>
<version>1.0.4</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>ant</id>
<version>1.6.2</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.7.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-dbcp</id>
<version>1.2</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-pool</id>
<version>1.2</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-dbutils</id>
<version>1.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-collections</id>
<version>3.1</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-configuration</id>
<version>1.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-io</id>
<version>1.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-jxpath</id>
<version>1.2</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<id>commons-lang</id>
<version>2.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>2.1.8</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.0.2</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>1.4.3</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.4</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>odmg</groupId>
<artifactId>odmg</artifactId>
<version>3.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>0.9</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>springframework</groupId>
<artifactId>spring</artifactId>
<version>1.1.5</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<!-- web -->
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.2.1</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.6</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.1.3</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>1.2.4</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>displaytag</groupId>
<artifactId>displaytag</artifactId>
<version>1.0</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>itext</groupId>
<artifactId>itext</artifactId>
<version>0.99</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.1</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.1.1</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.2</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
<version>2.0.8</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<!-- compile / test -->
<dependency>
<id>servletapi</id>
<version>2.3</version>
</dependency>
<dependency>
<id>junit</id>
<version>3.8.1</version>
</dependency>
<dependency>
<id>postgresql</id>
<version>7.4.1-jdbc3</version>
</dependency>
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc-14</artifactId>
<version>10.1.0.2.0</version>
</dependency>
<!-- mda -->
<dependency>
<groupId>andromda</groupId>
<artifactId>andromda-profile</artifactId>
<version>${andromda}</version>
<type>xml.zip</type>
</dependency>
<dependency>
<groupId>andromda</groupId>
<artifactId>andromda-java-cartridge</artifactId>
<version>${andromda}</version>
<properties>
<enumerations>${maven.build.dir}/java</enumerations>
<exceptions>${maven.build.dir}/java</exceptions>
<value-objects>${maven.build.dir}/java</value-objects>
</properties>
</dependency>
<dependency>
<groupId>andromda</groupId>
<artifactId>maven-andromda-plugin</artifactId>
<version>${andromda}</version>
<type>plugin</type>
<properties>
<languageMappingsUri>Java</languageMappingsUri>
<wrapperMappingsUri>JavaWrapper</wrapperMappingsUri>
<sqlMappingsUri>PostgreSQL</sqlMappingsUri>
<jdbcMappingsUri>JDBC</jdbcMappingsUri>
<maxSqlNameLength>30</maxSqlNameLength>
<foreignKeySuffix>_FK</foreignKeySuffix>
<ejbJndiNamePrefix>${pom.id}</ejbJndiNamePrefix>
<classifierNameMask>none</classifierNameMask>
<classifierPropertyNameMask>none</classifierPropertyNameMask>
<operationNameMask>none</operationNameMask>
<roleNameMask>none</roleNameMask>
<enumerationNameMask>none</enumerationNameMask>
<enumerationLiteralNameMask>none</enumerationLiteralNameMask>
<entityNameMask>none</entityNameMask>
<entityPropertyNameMask>none</entityPropertyNameMask>
<parameterNameMask>none</parameterNameMask>
</properties>
</dependency>
<dependency>
<groupId>andromda</groupId>
<artifactId>andromda-spring-cartridge</artifactId>
<version>${andromda}</version>
<type>jar</type>
<properties>
<dataSource>java:/DbUtilDS</dataSource>
<hibernateDialect>
net.sf.hibernate.dialect.PostgreSQLDialect</hibernateDialect>
<hibernateShowSql>false</hibernateShowSql>
<hibernateUseQueryCache>false</hibernateUseQueryCache>
<hibernateQueryUseNamedParameters>
true</hibernateQueryUseNamedParameters>
<hibernateCacheProvider>
net.sf.hibernate.cache.EhCacheProvider</hibernateCacheProvider>
<hibernateInheritanceStrategy>
subclass</hibernateInheritanceStrategy>
<hibernateQueryCacheFactory>
net.sf.hibernate.cache.StandardQueryCacheFactory</hibernateQueryCacheFactory>
<springTypesPackage>${pom.package}</springTypesPackage>
<daos>${maven.build.dir}/java</daos>
<dao-impls>${maven.src.dir}/java</dao-impls>
<spring-configuration>
${maven.build.dir}/java</spring-configuration>
<services>${maven.build.dir}/java</services>
<service-impls>${maven.src.dir}/java</service-impls>
</properties>
</dependency>
<dependency>
<groupId>andromda</groupId>
<artifactId>andromda-hibernate-cartridge</artifactId>
<version>${andromda}</version>
<type>jar</type>
<properties>
<hibernateTypeMappingsUri>Hibernate</hibernateTypeMappingsUri>
<hibernateInheritanceStrategy>
subclass</hibernateInheritanceStrategy>
<defaultHibernateGeneratorClass>
native</defaultHibernateGeneratorClass>
<hibernateDefaultCascade>none</hibernateDefaultCascade>
<entities>${maven.build.dir}/java</entities>
<entity-impls>${maven.src.dir}/java</entity-impls>
<customTypesPackage>${pom.package}</customTypesPackage>
<compositionDefinesEagerLoading>
true</compositionDefinesEagerLoading>
</properties>
</dependency>
<dependency>
<groupId>andromda</groupId>
<artifactId>andromda-bpm4struts-cartridge</artifactId>
<version>${andromda}</version>
<properties>
<actions>${maven.build.dir}/java</actions>
<forms>${maven.build.dir}/java</forms>
<controllers>${maven.build.dir}/java</controllers>
<controller-impls>${maven.src.dir}/java</controller-impls>
<pages>${maven.build.dir}/webapp</pages>
<decorators>${maven.build.dir}/webapp</decorators>
<messages>${maven.build.dir}/webapp/WEB-INF/classes</messages>
<configuration>${maven.build.dir}/webapp/WEB-INF</configuration>
<security>false</security>
<securityRealm>other</securityRealm>
<serviceAccessorPattern>
${pom.package}.ServiceLocator.instance().get{1}()</serviceAccessorPattern>
<mergeLocation>${maven.src.dir}/mda</mergeLocation>
<mergeMappingsUri>
file:${maven.src.dir}/mda/mappings/bpm4struts.xml</mergeMappingsUri>
<defaultDateFormat>MM/dd/yyyy</defaultDateFormat>
<xhtml>true</xhtml>
</properties>
</dependency>
<dependency>
<groupId>andromda</groupId>
<artifactId>andromda-ocl-validation-library</artifactId>
<version>${andromda}</version>
</dependency>
<dependency>
<groupId>andromda</groupId>
<artifactId>andromda-ocl-query-library</artifactId>
<version>${andromda}</version>
</dependency>
</dependencies>
<build>
<nagEmailAddress>[EMAIL PROTECTED]</nagEmailAddress>
<sourceDirectory>src/java</sourceDirectory>
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
<unitTest>
<excludes>
<exclude>**/*Test.java</exclude>
</excludes>
<resource>
<directory>src/test</directory>
</resource>
</unitTest>
<resources>
<resource>
<directory>src/java</directory>
</resource>
<resource>
<directory>target/java</directory>
</resource>
</resources>
</build>
<reports>
<report>maven-jdepend-plugin</report>
</reports>
</project>