You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by DBallinger <d....@abm-uk.com> on 2008/10/17 13:00:24 UTC

Multi-module ant built dependency

I am trying to package a legacy project using its current ant build script
and provide it as a dependency in a Maven managed project. To achieve this,
I have created a project with two modules. One module uses the ant plugin to
call the legacy ant script. The other module contains the new software that
is dependent on the legacy project.

If I perform a maven install on the modules independently, the legacy
project gets packaged correcly and added to the maven repository. The second
module too then gets compiled, packaged and installed correctly.

However, if I perform a maven install for the parent pom, the legacy project
gets processed as before but the compilation of the second module fails as
the compiler cannot find symbols contained in the legacy project. It appears
that it cannot find the dependeny that just got installed.

Can anyone see any problems with what I'm trying to do here or am I just
going about this the wrong way. Any advice would be appreciated as I've been
searching for an answer for a while.

Thanks


For reference, my poms are as follows...

Parent pom.xml:
<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>djb</groupId>
	<artifactId>mp</artifactId>
	<packaging>pom</packaging>
	<name>maven-project</name>
	<version>0.0.1-SNAPSHOT</version>
	<properties>
		<project_root>C:/test/multiProject/maven</project_root>
	</properties>
	<modules>
		<module>legacy</module>
		<module>mp1</module>
	</modules>
</project>


Legacy pom.xml:
<project>
	<version>1.0</version>
	<parent>
		<groupId>djb</groupId>
		<artifactId>mp</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<groupId>djb</groupId>
	<artifactId>legacy</artifactId>
	<build>
		<plugins>
			<plugin>
				<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
				<artifactId>maven-antrun-extended-plugin</artifactId>
				<version>1.32</version>
				<dependencies>
					<dependency>
						<groupId>sun.jdk</groupId>
						<artifactId>tools</artifactId>
						<version>1.5.0</version>
						<scope>system</scope>
						<systemPath>C:\Program
Files\Java\jdk1.5.0_15\lib\tools.jar</systemPath>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<phase>package</phase>
						<configuration>
							<tasks>
								<ant dir="${project_root}/../legacy" target="jar-file" />
								<echo message="Attaching jar: ${project_root}/../legacy/legacy.jar"
/>
								<attachArtifact file="${project_root}/../legacy/legacy.jar" />
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


Mp1 pom.xml:
<project>
	<parent>
		<groupId>djb</groupId>
		<artifactId>mp</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<groupId>djb</groupId>
	<artifactId>mp1</artifactId>
	<packaging>jar</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>mp1</name>
	<url>http://maven.apache.org</url>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>djb</groupId>
			<artifactId>legacy</artifactId>
			<version>1.0</version>
		</dependency>
	</dependencies>
</project>

-- 
View this message in context: http://www.nabble.com/Multi-module-ant-built-dependency-tp20031160p20031160.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org