Which maven2 artifacts are necessary to build a WS with CXF and Spring? - maven-2

I'm trying to build a WS with Spring 3.0 and CXF. I'm following the steps of this article http://www.ibm.com/developerworks/library/ws-pojo-springcxf/
But in that article, the authors assume that you have cxf installed. I'd like to embed CXF in my .war.
Thanks in advance.

Normally, just depend on cxf-rt-frontend-jaxws and cxf-rt-transport-http. Pretty much the rest of the stuff needed would be pulled in transitively from those. (might not even need cxf-rt-transport-http) That would cover 90% of the usecases.
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>2.2.5</version>
</dependency>
For more advanced things like WS-Security and WS-RM and JAX-RS, you would need to add additional modules.

Related

How to use Bean Validation in a Helidon App?

I'm trying to create a simple Rest Resource using Helidon-MP but for some reason it doesn't work when I add the bean validation annotations on my method.
#POST
public Response generatePlan(#Valid #ValidPlan JsonObject payload) {
// some logic here
}
Is this the expected behavior? Or Should I add some dependency or configuration?
I tried to find something on the documentation, but I couldn't.
Thanks
I ended up doing as #LairdNelson answered and added the following dependencies in my pom.xml:
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.1.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>6.1.5.Final</version>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
</dependency>
Bean validation is not part of the MicroProfile set of specifications, so by default it is not part of Helidon MP, which is a MicroProfile implementation.
You may of course add an implementation of Bean Validation on your compile or runtime classpath provided it is a CDI portable extension (which is how you add arbitrary capabilities to any MicroProfile-compliant implementation). One such portable extension is the Hibernate Validator-backed one. There may certainly be others.

How to easily upgrade Karate Version?

I would like to upgrade to Karate 0.9.0 which is released recently. How can i do this easily. My existing .pom file contains many dependencies in 0.8.0 version. Should i replace each with updated one? Or, is there a better way to do this?
And again, i can see many RC versions of dependencies in maven repository which one's stable?
And, Finally, Is there any separate dependency for KarateOptions? Because, I was using 0.8.0 and was not able to find any dependency jars for this.
This is actually a maven question. But yes the recommended practice is to define a maven "property" once and then use it in the multiple places.
I'm surprised, because at the max you should have only 2.
<properties>
<karate.version>0.9.0</karate.version>
</properties>
<dependencies>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>${karate.version}</version>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit4</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
And yes, KarateOptions is new in 0.9.0 - please read the release notes carefully and you don't even need to change that immediately when you upgrade: https://github.com/intuit/karate/releases/tag/v0.9.0

Using jira REST api

I'm currently trying to get worklogs from jira through java. I'm reading the documentation, about it(https://developer.atlassian.com/cloud/jira/platform/rest/#api/2/issue-createIssue) but i simply can't find some basic information like:
How do i start using that api with java ? Did i have to add something to my pom.xml ? If yes, what dependency ?
For my task(get worklogs), it's better use the java api or the rest API ?
Any of you guys can send me a light, recommend me a book or article about it or something ?
Thx in advance guys.
If its help you, I give you link to my repo on git, there is program to load scenario test to Jira with Zephyr.
There is two simple endpoints, to send post method.
Github
My pom:
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
You can use JIRA's internal Java API, for example, with Groovy scripts via ScriptRunner plugin for JIRA.
You should import ComponentAccessor to get basic JIRA helper classes for the rest of logic.
Here is a Groovy script snippet to get all Worklog objects for a given issue:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.worklog.WorklogManager
worklogManager = ComponentAccessor.getWorklogManager()
def issueWorklogItems = worklogManager.getByIssue(issue)
If you want to read/modify Jira issue from an external code then you can use Jira Rest APIs. Following links will be helpful to understand fetching/updating worklog details for an jira issue,
To get all work logs for an Jira issue,
https://docs.atlassian.com/software/jira/docs/api/REST/8.0.2/#api/2/issue-getIssueWorklog
TO fetch specific worklog for an Jira issue,
https://docs.atlassian.com/software/jira/docs/api/REST/8.0.2/#api/2/issue-getIssueWorklog

Pentaho kettle engine is breaking the jboss7.1.3 logging

We're currently developing a project in javaee6 we migrated from seam2.3. And we have a dependency on kettle-engine.
What I found was kettle-engine is causing the jboss logging to break down, I mean it's not logging. I tried with a fresh project and just include this project in the dependency and the same problem occurs.
Any idea why? I'm using javaee6 maven archetype and here's the dependency:
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-engine</artifactId>
<version>4.2.0-GA</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
Our findings end in the conclusion that the technologies we're using jboss7.1.3/javaee6/pentaho kettle-engine are not compatible together. Fortunately we already started the plan to drop kettle-engine in favor of EJB Timers.
So what worked for me is to removed all kettle* dependencies.

How to make IntelliJ understand annotations

I have recently switched from using Eclipse to IntelliJ, and am preferring the experience.
However, the IDE is not understanding any of the Annotations. I am using Spring #Autowired annotation as well as some of the Spring-WS annotations and the IDE is telling me that they are unresolved.
When the project is built using Maven, it builds fine, and the Annotations are recognised in Eclipse.
Im sure this is a simple setup thing, but cannot find any information on how to set it up.
As Peter said, when correctly importing the Maven project the dependencies should be correctly recognized. The IntelliJ manual has a section on how to import a Maven project.
For the record, in our project pom, we have the following dependencies:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
The former two have been present already before implementing a web service, so they may not be required strictly for web services.