]> source.dussan.org Git - gitblit.git/commit
Reworked NetBeans project to be based on the pom.xml rather than the build.xml. 263/head
authorEddy Young <jeyoung@priscimon.com>
Sun, 24 May 2015 08:50:07 +0000 (09:50 +0100)
committerEddy Young <jeyoung@priscimon.com>
Sun, 24 May 2015 08:50:07 +0000 (09:50 +0100)
commitbc62240584d63bccce790534e12641ec38bb35ad
tree85b1133b22b9198ccb224e1ebabaa2de819495af
parentf1652e33304c6dc361fb119fcdc768dbc8bf71b4
Reworked NetBeans project to be based on the pom.xml rather than the build.xml.

Maven pom.xml is the new default for organising NetBeans projects, but the structure of the gitblit source folder is unusual because of the placement of the bugtraq source in the tree and Maven does not support this by default. This change introduces Maven Build Helper plugin to integrate the additional source locations. This is preferable to using nbproject\project.xml because 1) there is no need to generate the classpath for that file from build.moxie and 2) the POM generated by build.moxie can be re-used almost as-is, with the following additional configuration.

Additional Maven Build Helper (add under build/plugins):

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source-bugtraq</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/bugtraq</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-test-source-bugtraq</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/bugtraq</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                    <targetPath>resources</targetPath>
                                    <excludes>
                                        <exclude>**/junk/**</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>add-test-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/test/resources</directory>
                                    <targetPath>resources</targetPath>
                                    <excludes>
                                        <exclude>**/junk/**</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>

            </plugin>

Source configuration (add at the end of pom.xml):

    <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
nbproject/project.xml [deleted file]