apache-camel-swagger-plugin Maven Plugin

Maven plugin which serves to generate swagger file from Route definitions during build time.

License

License

Categories

Categories

Maven Build Tools Apache Camel Application Layer Libs Messaging Swagger Program Interface REST Frameworks
GroupId

GroupId

cz.kahle.maven
ArtifactId

ArtifactId

apache-camel-swagger-plugin
Last Version

Last Version

1.0.7
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

apache-camel-swagger-plugin Maven Plugin
Maven plugin which serves to generate swagger file from Route definitions during build time.
Project URL

Project URL

https://github.com/PavelKa/apache-camel-swagger-plugin
Source Code Management

Source Code Management

https://github.com/PavelKa/apache-camel-swagger-plugin

Download apache-camel-swagger-plugin

How to add to project

<plugin>
    <groupId>cz.kahle.maven</groupId>
    <artifactId>apache-camel-swagger-plugin</artifactId>
    <version>1.0.7</version>
</plugin>

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.camel.springboot : camel-swagger-java-starter jar 3.3.0
org.apache.camel : camel-api jar 3.3.0

provided (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.5.2
org.apache.maven : maven-core jar 3.5.2
org.apache.maven : maven-artifact jar 3.5.2
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5.2

test (3)

Group / Artifact Type Version
org.apache.maven : maven-compat jar 3.5.2
junit : junit jar 4.12
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0

Project Modules

There are no modules declared in this project.

#Apache camel swagger plugin This plugin supports following goal

  • generateSwagger - To generate swagger file from RestConfigurationDefinition

Library camel-swagger-java exposes swagger only during runtime. There is a need to work with static swagger file in some tools. For example during a build of maven project a swagger file is used in camel-restdsl-swagger plugin to generate consumer REST DSL RouteBuilder source code.

Adding plugin to your pom.xml

    <plugin>
                <groupId>cz.kahle.maven</groupId>
                <artifactId>apache-camel-swagger-plugin</artifactId>
                <version>1.0.5-SNAPSHOT</version>
                <dependencies>
                    <dependency>
                        <groupId>XY</groupId>
                        <artifactId>YY</artifactId>
                        <version>1.0.0-SNAPSHOT</version>
                        <scope>compile</scope>
                        <exclusions>
                            <exclusion>
                                <groupId>com.fasterxml.jackson.core</groupId>
                                <artifactId>jackson-core</artifactId>
                            </exclusion>
                            <exclusion>
                                <groupId>com.sun.xml.bind</groupId>
                                <artifactId>*</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
                <configuration>
                    <outputDir>${project.basedir}/target/generated-resources/swaggers</outputDir>
                    <routeBuilders>
                        <!-- List of Router classes Dependency should be defined also on project level-->
                        <routeBuilder>xy.CamelRouter</routeBuilder>
                    </routeBuilders>
                    <schemes>
                        <scheme>https</scheme>
                        <scheme>http</scheme>
                    </schemes>
                </configuration>
                <executions>
                    <execution>
                        <id>generateSwagger</id>
                        <goals>
                            <goal>generateSwagger</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

##Don't forget The Spring Boot Maven and Gradle plugins both package our application as executable JARs – such a file can't be used in another project since class files are put into BOOT-INF/classes. This is not a bug, but a feature. Classifier exec can solve this problem....

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <classifier>exec</classifier>
    </configuration>
</plugin>

Run integration tests

mvn clean verify -P run-its

Release plugin

mvn release:prepare -P ossrh,release-sign-artifacts -Dresume=false
mvn release:perform -P ossrh,release-sign-artifacts

Versions

Version
1.0.7
1.0.6
1.0.5
1.0.3
1.0.2
1.0.1