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

Add sources and javadoc by default #4

Open
phansson opened this issue Oct 22, 2016 · 1 comment
Open

Add sources and javadoc by default #4

phansson opened this issue Oct 22, 2016 · 1 comment

Comments

@phansson
Copy link

phansson commented Oct 22, 2016

It is really best-practice for an add-on to include source and javadoc, so the archetype should reflect that. Here's what works for me (additions to pom.xml):

   <profiles>
        <profile>
            <id>directorypackage</id>
            <build>
                <plugins>
                    ...
                    ...
                    ...
                    <!-- Generate Javadoc jar as well. 
                         (it will be included in the zip if it exists).
                         Remove this section if you do not want to include
                         Javadoc in the zip.
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Generate source jar as well. 
                         (it will be included in the zip if it exists).
                         Remove this section if you do not want to include sources in the zip, 
                         for example for commercial closed-source add-ons.
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    ...
               </plugins>
            </build>
        </profile>
    </profiles>
@mstahv
Copy link
Member

mstahv commented Oct 29, 2016

It sure is. I guess you are not using release plugin to create releases? It makes source and javadoc jars as well (and included in zip packages).

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

No branches or pull requests

2 participants