I start learning packaging for several distros (currently Cygwin and Debian).
They have requirement to build system to allow out-of-tree build (syno
You could do like this to get it in your current working directory:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.stackoverflow</groupId>
<artifactId>Q13173063</artifactId>
<version>1.0-SNAPSHOT</version>
<name>${project.artifactId}-${project.version}</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<buildDir>${user.dir}</buildDir>
</properties>
<build>
<directory>${buildDir}</directory>
</build>
</project>
Then you can issue
mvn -f my-app/pom.xml compile
And it will give you your classes in the current working directory.
And easily change to another output directory:
mvn -f my-app/pom.xml -DbuildDir=/tmp/build compile
It might be as simple as having a
<build>
<directory>/your/build/directory</directory>
</build>
in your pom.xml. /your/build/directory
need not be in the source tree and can be parameterized using the usual ${...}
syntax.
Cheers,