How to generate swagger file during maven build - apache-camel

Library camel-swagger-java expose swagger during runtime generated based on RestConfigurationDefinition.
Is it possible to generate a swagger file during a maven build?
The only possibility I've already found is to generate a swagger during JUnit test execution, when Spring context is running, which is clumsy.

Finally, I made a simple maven plugin which can be used for swagger generation during maven build. https://github.com/PavelKa/apache-camel-swagger-plugin

Related

Google Endpoints V2 and Maven plugin version?

We have a multi-module (war-packaged) project that uses com.google.appengine - appengine-maven-plugin target being ear file.
We have migrated succesfully to Java8 and EndpointsV2. It builds and runs fine in Cloud. However the following requirement is still a bit questionmark in the migration instructions. What is the reason behind this incompatibility and requirement? Or is it just related to for example "discovery docs" that we are not using anyway?
The old App Engine Maven plugin, with group com.google.appengine, is incompatible with the Endpoints Framework plugin. You must use the new version shown above
https://cloud.google.com/endpoints/docs/frameworks/java/migrating
If you aren't using discovery docs or generated client libraries and are only using Endpoints as a library dependency, you can remove the Endpoints plugin and the error should go away.

Single page application using grunt and tomcat

We are building single page application, using AngularJS and Spring Rest services along with spring boot. For front end build we are using grunt and for server site build maven. But we are not sure hove to build single WAR file which contains build out put from gunt and our java output.
Deployment server Tomcat.
Regards
Mahesh
You can give a try using maven-grunt plugin.
https://github.com/allegro/grunt-maven-plugin
I have the exact same setup. I am invoking grunt from maven.
From maven I invoke frontend-maven-plugin it actually downloads node binary and all node packages. And invokes grunt and bower. This essentially helps me build my project in any environment without installing node(even in Jekins server). Configure warSourceDirectory to read grunts output.

How to set up build with git-hosted external frontend project included?

I have a Play 2.2 Application which strickly used only to implement REST API.
I have in an independent GIT repo a AngularJS application. This application uses Grunt and NodeJS to do the build.
The Result of the frontend application is an index.html + 1 js file and 1 css file.
Ideally I would like to invoke the Grunt build script from SBT which builds the angularjs app.
Is there a SBT plugin I can use to do this ?
What is the best approach I should use to do this the most simple way ?
At the moment I build it manually and copy the static resources into my PLAY's public folder.
Thanks in advance
I've never done it before, but a quick Google search gave me sbt-grunt-plugin whose the last commit was authored on Feb 20, 2013 :(
The plugin is a bit outdated, but is doing what I'd propose -- offers a command (could also be a task) that wraps grunt (as the plugin above does). You may also want to read the official documentation of sbt about Commands.
I would then declare a dependency on the angularjs/frontend project using RootProject for the root project with frontend (angularjs) and backend (Play Framework) submodules - see How can sbt pull dependency artifacts from git?:
lazy val frontend = RootProject(uri("git://..."))
lazy val backend = project ...
The root project is auto-created by sbt as described in Default root project:
If a project is not defined for the root directory in the build, sbt
creates a default one that aggregates all other projects in the build.
frontend would need to have build.sbt with the task created and it should work fairly well (it might be the only viable solution to not tie the projects too much and create unnecessary inter-dependencies).

How to generate CXF beans.xml using wsdl2java maven?

When I use eclipse to generate jaxb classes and Webservice implementation by top down approach. eclipse automatically generates csf-beans.xml. However wsdl1java maven plugin doesnot generate config file. Is there are options available to plugin to enable generation of bean configuration file?
No! There isn't any option for generating cxf configuration file with wsdl2java maven plugin. You can get and customize the general cxf.xml file from Apache CXF Configuration and add it to the /WEB-INF/classes folder of your web application.
Hope this helps.

How to convert maven project to web application project?

I want to convert a maven project to a web application project, which should contain web.xml. I am using eclipse juno 4.2 with m2e (maven integration for eclipse) plugin software.
Any reply would be appreciated.
Install m2e-wtp
In your pom.xml, change or add the war packaging
right-click on project > Maven > Update project
m2e-wtp will create the src/main/webapp folder and add the Dynamic Web project Facet¤
manually add a WEB-INF folder under src/main/webapp
right-click on project > Java EE Tools > Generate Deployment Descriptor stub
It will create a web.xml under src/main/webapp/WEB-INF/
¤ By default, the web facet is set to 2.5. You should update it, if needed, under project properties > Project Facets BEFORE generating the web.xml
I assume your current project is a maven project which produces jar. Please confirm.
I have not come across any utility which can convert a jar project to a war project.
You have following two options -
Simple open the pom.xml and change jar to war. Create folder webapp under src/main and create a web.xml
Create a new web app project via maven command line choosing webapp archetype or via eclipse choosing maven webapp achetype. Define dependency to your jar project.
If you can provide more information based on my suggestion then probably I can help.

Resources