Hi,

Because there is no m2 middlegen plugin yet, I try to run middlegen
from an ant build file. But when I try to run the build file using
"mvn compile" I get an exception with the following message:

Embedded error: The following error occurred while executing this line:
C:\UserPortal\middlegen_build.xml:46: Could not create type middlegen
due to middlegen.jar should not be on the system classpath when
starting Ant. It should be on a path passed to the <taskdef> using
classpath or classpathref.

The exception is thrown from within the middlegen code. It seems the
system classpath is containing the middlegen.jar. Does anyone know how
I can modify the system classpath when using the maven-antrun-plugin
or does anyone have another suggestion how to work-around this error?

Thanks, Jasper


The target form the middlegen_build.xml:

    <target name="test">
        <taskdef name="middlegen" classname="middlegen.MiddlegenTask"
classpathref="maven.dependency.classpath"/>
        <middlegen
            appname="${app.name}"
            prefsdir="${basedir}"
            databaseurl="${database.url}"
            driver="${database.driver}"
            username="${database.userid}"
            password="${database.password}"
        >
        </middlegen>
    </target>

The pom.xml:
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                  <execution>
                    <phase>generate-sources</phase>
                    <configuration>
                      <tasks>

                        <ant antfile="${basedir}/middlegen_build.xml"
inheritRefs="true">
                            <target name="test"/>
                            <property name="appname"          
value="${project.name}"/>
                            <property name="database.url"     
value="${database.url}"/>
                            <property name="database.driver"  
value="org.gjt.mm.mysql.Driver"/>
                            <property name="database.userid"  
value="${mysql.userid}"/>
                            <property name="database.password"
value="${mysql.password}"/>
                        </ant>

                      </tasks>
                     
<sourceRoot>${project.build.directory}/generated-sources/main/java</sourceRoot>
                     
<testSourceRoot>${project.build.directory}/generated-sources/test/java</testSourceRoot>
                    </configuration>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>middlegen</groupId>
                        <artifactId>middlegen</artifactId>
                        <version>2.1</version>
                        <scope>runtime</scope>
                    </dependency>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>3.1.11</version>
                    </dependency>
                  </dependencies>
            </plugin>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to