Maven cannot locate dependencies in local repo - maven

I have declared all spring dependencies in a project of type pom and installed it.
My project's pom that uses the common dependencies pom is as follows. But it seems maven is not using/cannot locate the dependencies pom
<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>com.bookme</groupId>
<artifactId>portal</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>portal</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.bookme.common</groupId>
<artifactId>common-dependencies</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<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>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Can anyone tell me what am I doing wrong pls?
Thanks

Have you install you dependency pom to you local m2 repository?
Add scope as import to you dependency pom. Look here for more details
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.bookme.common</groupId>
<artifactId>common-dependencies</artifactId>
<version>1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Consider the following facts also
Do not attempt to import a pom that is defined in a submodule of the
current pom. Attempting to do that will result in the build failing
since it won't be able to locate the pom.
Never declare the pom importing a pom as the parent (or grandparent,
etc) of the target pom. There is no way to resolve the circularity
and an exception will be thrown.
When referring to artifacts whose poms have transitive dependencies
the project will need to specify versions of those artifacts as
managed dependencies. Not doing so will result in a build failure
since the artifact may not have a version specified. (This should be
considered a best practice in any case as it keeps the versions of
artifacts from changing from one build to the next).

Related

New GWT maven plugin

I'm getting the error below when when I try to compile.
The goal is gwt:compile
I do set the moduleName as a variable.
The module name is com.example.app.App
Same thing command line ~/work/projects/gwt/app$ mvn gwt:compile "-DmoduleName=com.example.app.App"
Failed to execute goal
net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-6:compile (default-cli) on
project mysandbox: The parameters 'moduleName' for goal
net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-6:compile are missing or
invalid -> [Help 1]
On the other hand mvn package worked.
Here's my pom:
<?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>com.example</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mavenVersion>3.0</mavenVersion>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.8.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<!-- Do not upgrade past 3.1 to avoid triggering https://issues.apache.org/jira/browse/MSOURCES-95 -->
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.14.v20161028</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-6</version>
<extensions>true</extensions>
<configuration>
<sourceLevel>1.8</sourceLevel>
<failOnError>true</failOnError>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>app-client</module>
<module>app-shared</module>
<module>app-server</module>
</modules>
</project>
So, you have a multi-module Maven project. Invoking mvn gwt:compile will try to execute that "goal" on each of the 4 modules (root module and 3 submodules). Because your moduleName property (used to configure the moduleName property of the gwt:compile goal) likely only exists in the app-client submodule, gwt:compile fails when applied to the root module or the app-shared submodule.
If you want to build your project, run mvn package (and if you don't want to run tests, pass -DskipTests).
Technically, you could also run mvn gwt:compile, but directly inside the submodule. For that to work, you'd first have to mvn install the app-shared submodule; otherwise Maven won't be able to resolve the dependency (as you would no longer be executing the full "reactor build".
For many reasons (see http://blog.lexspoon.org/2012/12/recursive-maven-considered-harmful.html and http://blog.ltgt.net/maven-is-broken-by-design/ as starting points), I highly discourage this practice (mvn install is an anti-pattern; most of the time what you want is actually mvn verify); and I also discourage using any phase before package with multi-module builds (which boils down to only ever using mvn package, possibly with -DskipTests, and mvn verify)

How to read values from .properties using maven plugin

How to read the properties from .properties file by using maven provided plugin, for one of my current project, I always used to set the properties in the <properties> tag of pom.xml, But here my requirement is, I will set the all properties in some .properties file for ex: dev.properties. It is having the following content inside it.
spring.package=org.springframework
spring.artifact=spring-core
spring.version=3.0.5.RELEASE
So, now I want to set the above properties into the pom.xml like the following:
<dependencies>
<dependency>
<groupId>spring.package</groupId>
<artifactId>spring.artifact</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
I gone through this link : How to read an external properties file in Maven
But it is giving the following error : Missing artifact org.springframework:spring-core:jar:spring.version
Here is the pom.xml
<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>com.ram</groupId>
<artifactId>DynamicProperties</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<spring.version>spring.version</spring.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<urls>
<url>file:///D:/Hadoop_Apps/DynamicProperties/src/main/resources/dev.properties</url>
</urls>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
</project>
But spring-core-3.0.5.RELEASE jar is avail in maven repository.
Is there any other plugin in maven to do the same, or did I missed any additional config here.
Please correct if I am wrong.
Thanks.
First of all, when Maven reads your pom.xml, it'll immediately replace placeholders such as ${spring.version} with the actual value you specify as
<properties>
<spring.version>spring.version</spring.version>
</properties>
So changing the values later via a plugin is too late! Maven will not do this, however, if there's no value available at this time. Therefore you can remove these properties from pom.xml and let Maven plugin define them later in build lifecycle. This usually solves uses of properties overridden by plugins, but...
Second, there might be still another problem: Maven will likely resolve dependencies (including their versions) before even executing any plugin, which will prevent you from doing this whole thing. If that's the case, you can move your properties to a profile and activate a certain profile instead.
<properties>
<!-- default goes here, when no profile is used -->
<spring.version>3.0.4-RELEASE</spring.version>
</properties>
<profiles>
<profile>
<id>dev</id>
<properties>
<spring.version>3.0.5-RELEASE</spring.version>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<spring.version>3.0.1-RELEASE</spring.version>
</properties>
</profile>
</profiles>
Please find below the corrected pom.
<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>com.ram</groupId>
<artifactId>DynamicProperties</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<spring-version>spring.version</spring-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<urls>
<url>file:///${basedir}\src\main\resources\config.properties</url>
</urls>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
The problem was in -
<spring.version>spring.version</spring.version>
tag. It should have been
<spring-version>spring.version</spring-version>
inside properties tag.
BR

Maven unpack transitive dependencies' JAR to a folder

I have two maven artifacts in my private repository, com.test.Parent and com.test.Child. Child is dependent on Parent.
The only thing I want Maven to do is to download the Child jar and everything it depends on, and then unpack it to a directory.
I was able to put together a pom.xml that downloads the Child by calling mvn clean dependency:unpack, however in order to download the transitive dependency I had to manually include it in the pom.
What I want is to call, for instance maven initialize and my required dependencies would be downloaded. What I have now is this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.test</groupId>
<artifactId>Child</artifactId>
<version>1.2.3</version>
<type>jar</type>
<includes>**</includes>
<excludes>META-INF/**</excludes>
<outputDirectory>somepath/sources</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-dependencies</id>
<phase>initialize</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeTransitive>false</excludeTransitive>
<includes>**</includes>
<outputDirectory>somepath/depend</outputDirectory>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.test</groupId>
<artifactId>Child</artifactId>
<version>1.2.3</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
</plugins>
However, when I run mvn clean initialize, only the Child files are downloaded and unpacked.
POM file of com.test.Child contains this:
<groupId>com.test</groupId>
<artifactId>Child</artifactId>
<version>1.2.3</version>
<dependencies>
<dependency>
<groupId>com.test</groupId>
<artifactId>Parent</artifactId>
<version>7.8.9</version>
</dependency>
</dependencies>
Do you see any problem with the setup? The endgame is that developers can just download one pom.xml, run mvn <something> and all the dependencies will be automatically downloaded and unpacked to a certain structure.
Thanks
Edit:
When I delete my local Maven repository and run this pom, both Child and Parent are downloaded. So the dependency is there, but Parent is not picked up by the unpack-dependencies goal.
I solved the issue by moving the <dependencies> block outside <plugins>. So the final POM structure is:
<project>
<build>
<plugins>
<plugin>
...
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.test</groupId>
<artifactId>Child</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>
</project>
But if anyone can explain to me why this helps, that would be appreciated.

IntelliJ and Maven shader plugin with multiple modules

I'm trying to build a fat jar witht he maven shader plugin. I am going a bit in circles fixing maven and breaking IntelliJ build, and viceversa.
My project is as follows (I left out the plugin section, which contains the shader plugin):
module-a - main project module, contains main class
module-b - module, used by A
module-c - module, used by A
module A pom:
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.my</groupId>
<artifactId>module-a</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../module-b</module>
<module>../module-c</module>
</modules>
<dependencies>
<dependency>
<groupId>com.my</groupId>
<artifactId>module-b</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.my</groupId>
<artifactId>module-c</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.clapper</groupId>
<artifactId>grizzled-slf4j_2.11</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http-experimental_2.11</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http-core-experimental_2.11</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream-experimental_2.11</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>net.ceedubs</groupId>
<artifactId>ficus_2.11</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.11</artifactId>
<version>2.4.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>allinone</shadedClassifierName>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.my.Service</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
module B and C poms are similar(except for the module names)
<?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>com.my</groupId>
<artifactId>module-b</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.11</artifactId>
<version>2.4.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
All modules are in the same directory at the same level. Although I can build via IntelliJ just fine, I cannot build module-a via maven, because it cannot find modules -b and -c. So in general, I can't build anything that references a local project, since Maven won't find them. Doesn't matter if I try it inside the IDE or from the command line.
Building module-a I get:
[ERROR] Failed to execute goal on project module-a: Could not resolve
dependencies for project com.my:module-a:pom:1.0-SNAPSHOT: The
following artifacts could not be resolved:
com.my:module-b:jar:1.0-SNAPSHOT, com.my:module-c:jar:1.0-SNAPSHOT:
Could not find artifact com.my:module-c:jar:1.0-SNAPSHOT -> [Help 1]
I realize I probably screwed up these poms, trying to play with dependencies vs. module references, but what is the proper way to reference a local module in a pom file, without having to install the module in a repository?
I read that I should be creating a fourth parent project which has module-a as parent, and use that project to create the shaded jar, but even with that approach, I'm failing to get it to locate modules in the same project, it only resolves repo modules.
<packaging>pom</packaging>
<modules>
<module>../module-b</module>
<module>../module-c</module>
</modules>
this part of your module-a's pom reflects that it is the parent of module-b and module-c but contrarily your module-b and c are missing the
<parent>
<groupId>com.my</groupId>
<artifactId>module-a</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Just an understanding, your module's pom shall include those dependencies which you might want to use as a library for the same. So I hope you want to use some code from module-b/c on your module-a to include them in your pom dependencies.
Or you may want to remove these lines from your module-a
<modules>
<module>../module-b</module>
<module>../module-c</module>
</modules>
considering all the modules are independent of each other in terms of hierarchy.

External jar found in Maven Web Application but not when being deployed

I recently created a Maven Web Application through Netbeans 7.3, using GlassFish 3.1.2. In this I use an external jar, so I added it in pom.xml:
<dependencies>
...
<dependency>
<groupId>be-fedict-eid-trust-service-client</groupId>
<artifactId>eid-trust-service-client</artifactId>
<version>1.0.1.RC5</version>
</dependency>
...
</dependencies>
It shows up correctly and I can refer it in my Bean. BUT when I deploy the application, I get an error that the class in the jar (which I referred to without problems before) can not be found.
java.lang.NoClassDefFoundError: be/fedict/trust/xkms2/XKMSServiceFactory
Since I'm not that familiar with Maven, I don't know how and where I can fix this. Looking at the generated WAR file, the jar is there correctly. I set addClasspath to true so it is in the Classpath of the Manifest, but this doesn't seem to help.
My libraries are in WEB-INF/lib and my Bean is in WEB-INF/classes.
Any thoughts or general directions to what this problem may be? I found this topic: Spring Web App with Maven dependency - class not found during deploy
but I don't see how I can make it work for me (assuming he found a solution).
Thanks in advance!
My full pom.xml:
<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>ISB</groupId>
<artifactId>eID</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>eID</name>
<repositories>
<repository>
<id>e-contract</id>
<url>https://www.e-contract.be/maven2</url>
</repository>
</repositories>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>be-fedict-eid-applet</groupId>
<artifactId>eid-applet-shared</artifactId>
<version>1.1.0.RC2</version>
</dependency>
<dependency>
<groupId>be.fedict.eid-applet</groupId>
<artifactId>eid-applet-service</artifactId>
<version>1.1.0.RC2</version>
</dependency>
<dependency>
<groupId>be-fedict-eid-applet</groupId>
<artifactId>eid-applet-service-spi</artifactId>
<version>1.1.0.RC2</version>
</dependency>
<dependency>
<groupId>be-fedict-eid-applet</groupId>
<artifactId>eid-applet-package</artifactId>
<version>1.1.0.RC2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>be-fedict-eid-trust-service-client</groupId>
<artifactId>eid-trust-service-client</artifactId>
<version>1.0.1.RC5</version>
</dependency>
</dependencies>
<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>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>copy</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>be-fedict-eid-applet</groupId>
<artifactId>eid-applet-package</artifactId>
<version>1.1.0.RC2</version>
<type>jar</type>
<outputDirectory>${project.build.directory}/${project.artifactID}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I'm not sure it has anything to do with your POM. I suspect it's the libraries used in the target container (Glassfish) -- a classpath issue. Each container does classloading a little differently. This question & answer might give you some ideas. If there are two, different versions of this artifact, one in container, one in your POM, you will have to tell the container which to use. WebLogic uses a weblogic.xml file for this.

Resources