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

jsondoc maven plugin #17

Closed
wants to merge 8 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@dernasherbrezon

dernasherbrezon commented Mar 28, 2014

Hi,

Just created jsonxoc-maven-plugin. It does the following:

  • take all project dependencies (including transition)
  • generate static .json file

Sample configuration:

            <plugin>
                <artifactId>jsondoc-maven-plugin</artifactId>
                <groupId>org.jsondoc</groupId>
                <version>1.0.3-SNAPSHOT</version>
                <configuration>
                    <version>12.0</version>
                    <basePath>http://localhost</basePath>
                    <packages>com.st.apiserver.v2</packages>
                    <outputFile>${basedir}/src/main/webapp/apidoc.json</outputFile>
                </configuration>
                <executions>
                    <execution>
                        <id>generate</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
@fabiomaffioletti

This comment has been minimized.

Show comment
Hide comment
@fabiomaffioletti

fabiomaffioletti Mar 29, 2014

Owner

Hello, thank you for the plugin (and other improvements), it's a good idea. I could not test get it to work due to an error: I inserted this plugin configuration in the jsondoc-sample-springmvc pom in this way:

<plugin>
             <groupId>org.jsondoc</groupId>
                <artifactId>jsondoc-maven-plugin</artifactId>
                <version>1.0.3-SNAPSHOT</version>
                <configuration>
                    <version>12.0</version>
                    <basePath>http://localhost:8080</basePath>
                    <packages>org.jsondoc.sample</packages>
                    <outputFile>${basedir}/src/main/webapp/apidoc.json</outputFile>
                </configuration>
                <executions>
                    <execution>
                        <id>generate</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
</plugin>

But when I run mvn package or mvn jsondoc:generate, I get this error:

[ERROR] Failed to execute goal org.jsondoc:jsondoc-maven-plugin:1.0.3-SNAPSHOT:generate (default-cli) on project jsondoc-sample-springmvc: unable to generate jsondoc: could not get type for name org.jsondoc.sample.pojo.Country -> [Help 1]

Owner

fabiomaffioletti commented Mar 29, 2014

Hello, thank you for the plugin (and other improvements), it's a good idea. I could not test get it to work due to an error: I inserted this plugin configuration in the jsondoc-sample-springmvc pom in this way:

<plugin>
             <groupId>org.jsondoc</groupId>
                <artifactId>jsondoc-maven-plugin</artifactId>
                <version>1.0.3-SNAPSHOT</version>
                <configuration>
                    <version>12.0</version>
                    <basePath>http://localhost:8080</basePath>
                    <packages>org.jsondoc.sample</packages>
                    <outputFile>${basedir}/src/main/webapp/apidoc.json</outputFile>
                </configuration>
                <executions>
                    <execution>
                        <id>generate</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
</plugin>

But when I run mvn package or mvn jsondoc:generate, I get this error:

[ERROR] Failed to execute goal org.jsondoc:jsondoc-maven-plugin:1.0.3-SNAPSHOT:generate (default-cli) on project jsondoc-sample-springmvc: unable to generate jsondoc: could not get type for name org.jsondoc.sample.pojo.Country -> [Help 1]

@dernasherbrezon

This comment has been minimized.

Show comment
Hide comment
@dernasherbrezon

dernasherbrezon Mar 30, 2014

Hi,

There was an issue when new classloader with maven transitive dependencies was not passed to Api*Doc classes.

Moved JSONDocUtils.getApiDoc to separate thread with new classloader. Committed to master

dernasherbrezon commented Mar 30, 2014

Hi,

There was an issue when new classloader with maven transitive dependencies was not passed to Api*Doc classes.

Moved JSONDocUtils.getApiDoc to separate thread with new classloader. Committed to master

@fabiomaffioletti

This comment has been minimized.

Show comment
Hide comment
@fabiomaffioletti

fabiomaffioletti Nov 28, 2014

Owner

Reimplemented using the new version of the core library.

Owner

fabiomaffioletti commented Nov 28, 2014

Reimplemented using the new version of the core library.

@fabiomaffioletti fabiomaffioletti added this to the 1.0.6 milestone Nov 28, 2014

@fabiomaffioletti fabiomaffioletti self-assigned this Nov 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment