Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked NetBeans project to be based on the pom.xml rather than the … #263

Merged
merged 1 commit into from Jun 15, 2015
Merged

Reworked NetBeans project to be based on the pom.xml rather than the … #263

merged 1 commit into from Jun 15, 2015

Conversation

jeyoung
Copy link
Contributor

@jeyoung jeyoung commented May 24, 2015

…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>

…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>
@gitblit
Copy link
Collaborator

gitblit commented May 26, 2015

Moxie frequently rewrites the pom.xml file. Your build plugin changes will be lost unless Moxie is patched somehow.

gitblit added a commit that referenced this pull request Jun 15, 2015
Reworked NetBeans project to be based on the pom.xml rather than the …
@gitblit gitblit merged commit 8cff8e7 into gitblit-org:develop Jun 15, 2015
@jeyoung jeyoung deleted the netbeans_support branch February 1, 2016 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants