2

I upgraded my project from Maven 1 to Maven 3. It works fine, but I have some other problems. Maven 3 does not have "properties" tag like below;

<dependency>
  <groupId>commons-logging</groupId>
    <properties>
        <cdstool.bundle>true</cdstool.bundle>
        <war.bundle>true</war.bundle>
    </properties>
</dependency>

But when making a release I need to know which dependency is needed for what, So I can copy them to related folders in my release folder.

This is Ant goal to create a release from previous Maven 1 version, it copies certain dependencies to certain folders by checking their "property", Below is an example but there are more than 1 target directory like this that jars needs to be copied

    <j:forEach var="lib" items="${pom.artifacts}">
        <j:set var="dep" value="${lib.dependency}"/>
        <j:if test="${dep.getProperty('cdstool.bundle')=='true'}">
            <ant:copy failonerror="true" todir="${maven.build.dir}/cdstool">

            </ant:copy>

        </j:if>
    </j:forEach>

How can I do this in my Current Maven 3 project without using Ant?

First I need to know dependency properties so I know what ti copy to where, which is missing in my current pom dependencies, because there is no properties tag. And then I need to copy them to folders I want, using a Maven Assembly plugin.

Spring
  • 11,333
  • 29
  • 116
  • 185
  • It is an interesting problem that I don't have a direct answer to. My initial gut feeling would be to read into the Maven assembly plugin; I'm pretty sure you're supposed to be using that to have control over what ends up where in the deployable artifacts. Probably there is no easy transition to be done, you'll have to find a new way to get the same result. – Gimby May 05 '14 at 14:35

1 Answers1

0

I suggest you create a separate assembly per bundle and then include or exclude the desired dependencies per assembly.

Harald Wellmann
  • 12,615
  • 4
  • 41
  • 63
  • tnx but your answer is too short, also if I could know how to include or exclude the dependencies given in a directory, I would be already doing it. they dont have properties so I cant check – Spring May 06 '14 at 08:03