can't resolve dependency versions conflict (NoSuchMethodError's) - java

I has a problem with (NoSuchMethodError) using commons-codec lib there are my pom: `http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.playtika</groupId>
<artifactId>InfraSessionsBuild</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>InfraSessionsBuild</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>InfraSession</groupId>
<artifactId>infra_session</artifactId>
<version>1.0.13</version>
<exclusions>
<exclusion>
<groupId>com.playtika</groupId>
<artifactId>playtika-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<artifactId>ConfigurationManager</artifactId>
<groupId>
com.playtika.services.configuration
</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.playtika</groupId>
<artifactId>game-event</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>artifactory</id>
<name>artifactory-releases</name>
<url>http://artifactory.corp/artifactory/libs-release-local</url>
</repository>
<snapshotRepository>
<id>artifactory-snapshot</id>
<name>artifactory-snapshot</name>
<url>http://artifactory.corp/artifactory/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>spy</id>
<name>Spy Repository</name>
<layout>default</layout>
<url>http://files.couchbase.com/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>artifactory</id>
<name>artifactory-releases</name>
<url>http://artifactory.corp/artifactory/libs-release-local</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>artifactory-snapshot</id>
<name>artifactory-snapshot</name>
<url>http://artifactory.corp/artifactory/libs-snapshot-local</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<updatePolicy>always</updatePolicy>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>com.cloudera.repository.releases</id>
<url>https://repository.cloudera.com/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>com.cloudera.repository.thirdparty</id>
<url>https://repository.cloudera.com/content/repositories/third-party/
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>resin-hessian</id>
<name>Hessian</name>
<url>http://caucho.com/m2</url>
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>InfraSessionAPI</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.playtika.InfraSessionAPI</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
`
here u can see dependency conflict
I used exclusions and dependencyManagement but result is the same
12:11:02,487 ERROR [SoapUI] An error occured [TestCase [Copy of Register] failed without assertions
], see error log for details
java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String([B)Ljava/lang/String;
at com.couchbase.client.http.HttpUtil.buildAuthHeader(HttpUtil.java:55)
could someone tell me better way to resolve this problem?

Add commons-codec dependency to infra_session project, and resolve it with higher version (1.5)

Related

When i am trying to use #ResController in my maven project it showing error " RestController can not be resolved to a type".Help me to resolve this

pom.xml
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.3.2.BUILD-SNAPSHOT
com.java
restful-web-service
0.0.1-SNAPSHOT
restful-web-service
Demo project for Spring Boot
<properties>
<java.version>14</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Here my simple code to create Rest api
package com.java.restfulwebservice;
#RestController
public class HelloworldController {
...
}
Please import the RestController like below :
import org.springframework.web.bind.annotation.RestController;

Storing base java project inside child project jar (maven, docker)

Thanks for having a look at this!
Max
In the future I'm going to building lots of microservices that are all based upon the same parent java project. These microservices are all going to be using spring cloud and docker.
I currently have the base java project and a child project. The main for each microservices should be inherited from the parent project.
Up till now I've been using
mvn clean package assembly:single
for building the jar for the microservice so that the parent is store inside the jar. Then to run
java -cp MicroService.jar path.to.parent.Main
Which is working fine. I'm sure it's not the best way to go about it and I'd love any advice about improvements.
My problem now is that I want to use docker:build
mvn clean package docker:build
After packaging the microservice using docker:build, how do I specify a path to the parent project's Main since the parent project is no longer being stored in the jar made from docker:build.
Microservice (child)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>0.0.1</modelVersion>
<groupId>com.example</groupId>
<artifactId>micro-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/libs-release-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>repository.springframework.maven.release</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.10</version>
<configuration>
<imageName>example</imageName>
<baseImage>java</baseImage>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<!-- copy the service's jar file from target into the root directory of the image -->
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
.
<!-- Removed other dependancies to save space -->
.
<dependency>
<groupId>com.example</groupId>
<artifactId>parent-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.BUILD-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
https://github.com/spotify/docker-maven-plugin
http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html
Solved
Thanks to #M. Deinum comment.
I changed to pom.xml to
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>0.0.1</modelVersion>
<groupId>com.example</groupId>
<artifactId>micro-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/libs-release-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>repository.springframework.maven.release</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.6.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
.
<!-- Removed other dependancies to save space -->
.
<dependency>
<groupId>com.example</groupId>
<artifactId>parent-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.BUILD-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
I now just run
mvn clean package

Exception while executing java class

I executed this command
mvn compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=crawler.Crawler
and found this
An exception occured while executing the Java class. org/apache/log4j/Logger
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" si:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>clojars.org</id>
<url>http://clojars.org/repo</url>
</repository>
<repository>
<id>twitter4j.org</id>
<name>twitter4j.org Repository</name>
<url>http://twitter4j.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
second part
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
Error
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
You need to add dependency on log4j
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
to your pom.xml file (after dependency on junit).
You can read about this dependency in maven repo:
http://mvnrepository.com/artifact/log4j/log4j/1.2.17

Can't get Libraries Maven Dependencies to show up

I switched from Juno Eclipse to Kepler and imported my Maven project. However "Maven Dependencies" doesn't show up under Project-Properties-Java Build Path-Libraries and thus i can't compile my project. In Maven Repositories view i can see all my dependencies jar files under Local Repositories. I can manually add External Jar Files but there must be a right way to load them dynamically. I can run "maven install" successfully from Eclipse. I've tried all suggestions from this forum such as - run Maven-Update Project, unchecked Maven-Resolve dependencies from Workspace projects, Window-Preferences-check "Download repository index updates on startup" and "Update Maven projects on startup". Something is weird about Kepler Eclipse. What am i missing?
Here is my pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxx.xxx</groupId>
<artifactId>actives</artifactId>
<version>3.1.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<id>jar-with-dependencies</id>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>com.xxx.xxx.xxx.xxx.XXX</mainClass>
</manifest>
</archive>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <!-- Include all depedencies in build -->
</descriptorRefs>
<!--<appendAssemblyId>false</appendAssemblyId> -->
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.3</version>
</extension>
</extensions>
</build>
<properties>
<root>.</root>
<xxx.releases>http://xxx.xxx.local/mave</xxx.releases>
<xxxx.releases>http://xxx.xxx.local/xxx/releases</xxx.releases>
<xxx.snapshots>http://xxx.associatesys.local/xxx/snapshots</xxx.snapshots>
<xxx.releases.distribution>scp://xxx.associatesys.local/../../../srv/www/release/xxxx/releases</xxx.releases.distribution>
<xxx.snapshots.distribution>scp://xxx.xxx.local/../../../srv/www/release/xxx/snapshots</xxx.snapshots.distribution>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>central</id>
<name>central</name>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>xxx-central</id>
<name>XXXCentral</name>
<url>http://xxx.xxx.local/maven2/central</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>xxx-releases</id>
<name>Internal ReleasesRepository</name>
<url>${xxx.releases}</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>xxx-releases</id>
<name>XXXReleases Repository</name>
<url>${xxx.releases}</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>xxx-snapshots</id>
<name>XXXX Snapshots Repository</name>
<url>${xxx.snapshots}</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>sqljdbc</groupId>
<artifactId>sqljdbc</artifactId>
<version>4</version>
</dependency>
<dependency>
<groupId>xxxx</groupId>
<artifactId>xxx-xxx</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.xxx.xxx.client</groupId>
<artifactId>xxx-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.xxx.xxx.xxx</groupId>
<artifactId>xxx-xxx</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.xxx.xxx.common</groupId>
<artifactId>xxx-common</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>xxx-releases</id>
<name>XXXXReleases Repository</name>
<url>${xxx.releases.distribution}</url>
</repository>
<snapshotRepository>
<id>xxx-snapshots</id>
<name>XXXSnapshots Repository</name>
<url>${xxx.snapshots.distribution}</url>
</snapshotRepository>
</distributionManagement>
UPDATE: i solved this problem by copy and paste .classpath and .project files from another Maven project in Eclipse (Kepler) that was created with no issues. I made minor adjustments to these 2 files. I compared pom.xml files and found no discrepancies that would prevent Eclipse from creating my Maven project. It's not an ideal solution but it works for now, no time to solving Eclipse "mysteries". Thanks for the below comments, they pointed me into a right direction and helped to understand a problem better.

How to add external EJB to an Arquillian JUnit project?

I have a Data project and an EJB project created. Now I have created another Arquillian project for testing the above two with it using JUnit. I have created pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.arquillian.unit.test</groupId>
<artifactId>arquillian-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>arquillian-test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>jboss-deprecated</id>
<name>JBoss Deprecated</name>
<url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jboss-maven2-brew</id>
<name>JBoss Maven 2 Brew Repository</name>
<url>http://repository.jboss.org/maven2-brew/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>FocalColectEJB/com/focalinfo/service</directory>
</testResource>
</testResources>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>jbossas-managed-5.1</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jbossas-managed-5.1</artifactId>
<version>1.0.0.CR3</version>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-server-manager</artifactId>
<version>1.0.3.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>5.1.0.GA</version>
<type>pom</type>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
How to map my ejbs in order to be able to test them in my Arquillian project?
You have a couple of options.
If your EJB and other JAR are deployed separately to your app, you can use multiple deployments in your test case. Only one is "testable" but both can be deployed. You can simplify the reading of this external JAR file using ShrinkWrap's maven resolver.
If they are wrapped in to a WAR or EAR, just use that WAR or EAR as your deployment.

Categories

Resources