Adding rampart.mar to classpath via Maven - eclipse

I have been trying to find a solution for this for several days, but with no avail.
I'm currently in the process of introducing Maven to some of my Java projects. One of them requires Axis2 and Rampart for WS Security.
I added all Axis2 and Rampart dependencies in pom.xml:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-core</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-policy</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-trust</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart</artifactId>
<version>1.5.2</version>
<type>mar</type>
</dependency>
When I import the project in Eclipse, rampart.mar is not there, and attempting to engage the rampart module on runtime causes a failure.
However, when I use maven-dependency-plugin to copy all dependencies to a specific repository, I see that the rampart mar file is there!
This makes me believe that this is a limitation in the Eclipse m2e plugin. Anyone stumbled upon this one before? I saw several similar questions on Stackoverflow that were left unanswered.

Related

drools dependencies for developing web app with embedded drools rules engine

I've developed a stand-alone drools application, with rules implemented via .drl files. I'm used the Eclipse IDE to develop the app. I want to embed this application in a web application using the tomcat web server package. I'd like to create a web app project in Eclipse and add the drools dependencies to the project, as needed. Which drools libraries/artifacts do I need to add to the project, e.g. kie and drools libraries/artifacts?
More specifically, if I create a maven-based web-app project using Eclipse. What other maven artifacts will I need to add to the POM for the drools capabilities?
The logic in the web application servlet will create a kie container and session, instantiate a set of Facts based on model definitions, insert the Facts into the session, fire the rules, and respond to the initial http request based on the results of rules evaluation.
I resolved the question I posed above a while ago. I'm posting an answer to close the question. I came up with a set of maven dependencies that I used to create a java servlet application that initializes and invokes an embedded DROOLS rules engine to process an http request. I've successfully tested the servlet-based application within a Tomcat server (v8.5). I used the Eclipse IDE to create the application as a maven-based project. The pom.xml file for the application has the following dependencies.
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>
<version>1.2.4</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>6.5.0.Final</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>6.5.0.Final</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>6.5.0.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>

Jersery #FormDataParam and FormDataContentDisposition is not working even after adding maven dependencies

I have added these 3 maven dependency. But when i try to use #FormDataParam and FormDataContentDisposition its showing red mark as it is not found. But I can see that in the multipart lib I am attaching image for reference.
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.27</version>
</dependency>
</dependencies>
Even after adding dependency in maven it was not working .. Then it showed me suggestion to fix project on the error statement,on clicking that suggestion it asked to add org.glassfish.jersey.media.multipart library to build . Then i simply selected it and ok....It started working

How to run a Ext GWT (GXT) application with Maven

I am trying to make a GXT 3.0 starting app with Maven support. I have successfully compiled and run the native GWT application with mvn gwt:compile gwt:run command
Howeven, when I added these dependecies:
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-uibinder</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-chart</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>uibinder-bridge</artifactId>
<version>2.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
and added this in the gwt.xml (module) file:
<inherits name="com.sencha.gxt.ui.GXT" />
I am getting this error (running the same mvn command as above):
GWT module com.sencha.gxt.ui.GXT not found
And looking from the Java build path of the project in the Maven Dependencies, I can see that the GXT jars have not been downloaded.
Full pom.xml here.
If you want the snapshot, make sure you have the repository tags for it as well, for wherever you are getting that build from. Otherwise use the latest release, 3.0.0-beta3.
If you are building your own local copies, or deploying to an internal repo, then 3.0.0-SNAPSHOT should work - make sure the jar can be found in your repo, and that you aren't running as offline.
Use these dependencies:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>
GXT does not require uibinder-bridge anymore according to Sencha forum.
All GXT uibinder features were incorporated into GWT 2.5.0 release.
GXT 3.0.1 is on maven central
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>

RequestFactory javax.validation.ValidationException NoClassDefFoundError

I use Guice along with GWT 2.4 but I get a javax.validation.ValidationException NoClassDefFoundError when I run the server. In the pom.xml file I referenced the correct dependency:
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>provided</scope>
</dependency>
but in Eclipse I can't see the validation-api-1.0.0.GA.jar in the Maven Dependencies tree. The behavior is pretty strange:
I can find validation-api-1.0.0.GA-sources.jar and javax.validation-validation-api-1.0.0.GA-sources.jar under the target directory. I don't understand why it's there.
In the Maven Dependencies tree of eclipse, I can see a reference to javax.validation-validation-api-1.0.0.GA-sources.jar which contains 5 packages but no classes.
Running the app outside eclipse works. I run it using mvn gwt:run.
Any ideas?
The problem came from the dependency gwt-user, I managed to fix it by excluding the dependency on validation-api:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>

Problem adding commons-configuration to m2eclipse

I want to use the apache commons configuration jars in my Maven project.
When I add it using m2Eclipse it produces this:
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>20041012.002804</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
This seems fine but it then givers me the error:
Missing artifact resources:resources:jar:1.0:compile
Can anyone help please?
Looks like you need to choose a reliable version. That one seems to be a snapshot build. Here is the excerpt from my project.
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
<type>jar</type>
<scope>compile</scope>
</dependency>