maven-junction-plugin

Maven 2 Plugin to create symbolic links between directories on windows or unix

Overview

This Plugin is execution wrapper for Junction on windows paltform and ln -s on unix.

The plugin provides 2 goals link and unlink

Plugin Configuration

Add configuration similar to the following to your POM:

            <plugin>
                <groupId>com.pyx4j</groupId>
                <artifactId>maven-junction-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>link</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>unlink</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>unlink</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>

                    <links>
                        <!-- link the html generated by client to webapp directory -->
                        <link>
                            <dst>${basedir}/src/main/webapp/client</dst>
                            <src>${basedir}/../client/target-4link</src>
                        </link>
                        <!-- link the lib webapp directory -->
                        <link>
                            <dst>${basedir}/src/main/webapp/WEB-INF/lib</dst>
                            <src>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</src>
                        </link>
                    </links>

                    <!-- create war classes that are composed ot two projects -->
                    <composeClasses>
                        <dst>${basedir}/src/main/webapp/WEB-INF/classes</dst>
                        <packages>
                            <package>
                                <name>server-resources</name>
                                <src>${basedir}/src/main/resources</src>
                            </package>
                            <package>
                                <name>com.corp.app.server</name>
                                <src>${project.build.directory}/classes</src>
                            </package>
                            <package>
                                <name>com.corp.app.domain</name>
                                <src>${basedir}/../domain/target/classes</src>
                            </package>
                        </packages>
                    </composeClasses>
                </configuration>
            </plugin>

Plugin dependencies

junction executable can be distributed using Maven repository. We have version in our repository. For this to work we have reference to this repository in pom.xml