views:

718

answers:

4

I would like to try using maven from ant (for exaple to build my Java SE apps that needs all dependencies stored in ./lib/*, or just because doing anything short of dependency management in maven is too damn hard ;)).

But the documentation is nonexistent, and google also didn't give me a clue on how to use them. So any good docs/tutorials? Or maybe someone just has some examples at hand?

+1  A: 

You might find the Maven Ant tasks useful.

Edit: Okay, maybe you will find this useful.

McWafflestix
Thanks its a good start :) will up you, but I'd this question to stay a little bit longer in unanswered questions.
jb
Well, you can up me without marking the question answered... :-) I'll up you on the question so it gets a little higher priority, in case someone else out there has a better bit of info than me.
McWafflestix
+2  A: 

for depenceny handling from ant give a try to ivy

dfa
+1  A: 

I do this using the maven assembly plugin... in the pom use the following

    <build>
     <plugins>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <descriptors>
                    <descriptor>build/maven-build.xml</descriptor>
                </descriptors>
            </configuration>
        </plugin>

And then in my maven-build.xml I have something like this...

<assembly>
 <id>dep</id>
 <formats>
  <format>tar.gz</format>
 </formats>
 <includeBaseDirectory>false</includeBaseDirectory>
 <fileSets>
  <fileSet>
   <directory>target</directory>
   <includes><include>*.jar</include></includes>
   <outputDirectory>/lib</outputDirectory>
  </fileSet>
  <fileSet>
   <includes>
     <include>*.sh</include>
   </includes>
   <fileMode>0755</fileMode>
  </fileSet>
 </fileSets>
 <dependencySets>
  <dependencySet>
   <outputDirectory>/lib</outputDirectory>
   <unpack>false</unpack>
   <scope>runtime</scope>
  </dependencySet>
 </dependencySets>
</assembly>
Jherico
A: 

Yes, I also found that there's very little documentation on this. So I tried to explain the Maven Ant Tasks in detail (with examples) here:

Why you should use the Maven Ant Tasks instead of Maven or Ivy

Peter Thomas