How to generate CXF beans.xml using wsdl2java maven? - cxf

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.

Related

How to generate swagger file during maven build

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

tomcat8 Maven plugin

Is anyone having idea on status of tomcat8 Maven Plugin. Is it ready for use or not ? I can locate the repository for it here but could not find this plugin on apache site. I tried using it with same configuration as that of tomcat7-maven-plugin but it does not start my application.
Go to following link
https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin/3.0-r1756463
copy paste the dependency tag
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1756463</version>
But still if your pom file shows can't locate repository
click on the download link in above url and download jar file and past it in <your-home-directory>/.m2/repository/org/apache/tomcat/maven/tomcat8-maven-plugin/3.0-r1756463
In your IDE update maven project
tomcat maven plugin is only available for tomcat7, you can try spring boot which has an embedded tomcat8, it also provides other containers, like jetty

deploying camel java-archetype projec to Fuse 6.2

I have created a java-archetype project for Camel. It is a simple REST hello world to receive a get request and return a string body. When I run this as Java application from Eclipse it works as intended.
When I take the jar and deploy it the Fuse "deploy" folder I can see in the logs that the bundle has started. The state is active and green. However the Camel tab does not appear.
The same works if I use blueprint but does not seem to do so using the java dsl. Is there an extra magic code you need to add for Fuse to pick up the camel context? Thanks
Yes for OSGi to startup you can use a spring or blueprint with a <camelContext> that starts Camel. If you use pure Java code you have to fight with OSGi and use an OSGI activator and setup all kind of OSGi stuff that gets you tiresome.
So add a blueprint xml file and add the <camelContext> and then you can refer to Java route builders, just as you can when doing spring xml: http://camel.apache.org/spring.html

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.

Unable to add cxf bundle package in Eclipse

I'm trying to learn apache cxf and axis2.
I created a java project in Eclipse Helios and also added Maven Integration for Eclipse. After that, I enabled Dependency Management on that project. But when I select add Dependency and enter cxf in the search box, it doesn't return any result.
According to the book I'm using (Developing Web Services with Apache CXF & Axis2), it should return org.apache.cxf bundle package.
Please advise.
Enter cxf-bundle instead of cxf. I don't know why, but entering cxf alone does not return any results. cxf-bundle does, though.

Resources