0

I have a multi-module Maven project, and some of the modules use Ant for the build.

One such module should depend on another, but the target module doesn't have any Java sources and so it doesn't produce any artifact. Can I add a dependency on such a module, or do I have to produce an empty JAR?

Dan Berindei
  • 7,054
  • 3
  • 41
  • 48
  • 2
    If it doesn't have Java sources, what does it include? – user944849 Oct 22 '14 at 13:06
  • A pom.xml, an Ant build.xml, and a bunch of resources. The Ant build downloads some stuff, overlays the resources, and the end result is then referenced by the Ant build script in the other module. – Dan Berindei Oct 23 '14 at 15:29
  • I'm not sure I understand the use case. If the module has resources, those may be packaged; jars may include other things besides .class files. What purpose does declaring a dependency on this project serve? Are you only trying to force a certain build order? – user944849 Oct 23 '14 at 16:20
  • Right, there is a dependency between the Ant scripts in 2 different modules, and I want to fix the build order. I could create a jar, but I don't need it for anything else, so I'd rather not do it. – Dan Berindei Oct 23 '14 at 18:25

1 Answers1

1

If the only goal is to fix the build order, try adding a dependency on the POM.

<dependency>
    <groupId>com.mycompany</groupId>
    <artifactId>project-built-by-ant</artifactId>
    <version>1.0</version>
    <type>pom</type>
</dependency>
user944849
  • 14,524
  • 2
  • 61
  • 83