maven-war-plugin maven-compiler-plugin - maven

i'm new to maven; I need to compile and packaging 2 war file in two different directory even if the source are the same (change only the web.xml file).
try to explain better:
directory structure of LT:
<DIR> LT1_war
<DIR> LT_war
pom.xml
a part of the pom is:
<modules>
<module>LT_war</module>
<module>LT1_war</module>
</modules>
inside the folder LT_war there is a pom and src-->main-->java
resources
webapp
this compile successful and also i packaging in a war LT_war (to deploy to tomcat)
I need a way in order to compile inside the directory LT1_war (using the source that are in the LT_war directory) and packaging using the webapp inside the LT_war directory (just changing the web.xml file)
I've try to write the pom inside the directory LT1_war but when i lunch mvn packaging it tell me:
[INFO] lt ................................................ SUCCESS [3.995s]
[INFO] LT ................................................ SUCCESS [1:12.629s]
[INFO] LT1 ............................................... FAILURE [41.367s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:59.716s
[INFO] Finished at: Tue Jul 08 23:50:43 CEST 2014
[INFO] Final Memory: 20M/200M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.0:war (default-war) on project LT1: Error assembling WAR: Deployment descriptor: D:\attivi
taTomcat7\LT\LT1_war\target\LT1\WEB-INF\web.xml does not exist. -> [Help 1]:
this is a part of the pom file inside LT1_war:
<build>
<finalName>LT1</finalName>
<resources>
<resource>
<directory>../LT_war/src/</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<excludes>**/.svn/**</excludes>
</configuration>
<executions>
<execution>
<id>exploded</id>
<phase>prepare-package</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
<execution>
<id>war</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

There is a few things that I kindly consider terribly wrong with what you're doing:
A Maven project should never access files that are outside of its own module's folder. So LT1 please stay out of LT's folder!
Try to keep WAR projects small if you can. Modularize your code anyway, and make the WAR just depend on JAR files that contain the actual meat
One WAR file "borrowing" stuff from the other WAR might then be better fixed by having both WAR files depend on the code that you moved into such JAR file(s)
Stop using Java 5 if you reasonably can; it's been EOL since 2009. Also, consider moving your source/target levels to the parent project, so you don't redefine the same, yet have a consistent Java version
Talking about old versions, how come you even still have .svn folders that you need to exclude (for a while now there's only a .svn folder in the root of your Subversion work space, that wouldn't affect the Maven WAR plugin)
So your project structure could look like this:
ROOT
MEAT (packaging JAR, where your classes live)
LT (packaging WAR, depends on MEAT)
LT1 (packaging WAR, depends on MEAT, and stays the heck out of LT)
Addition (forgotten some aspect, as pointed out in comment)...
While MEAT is of packaging JAR, you want it to also include stuff that you had going into webapp without it ending up on the classpath. Provided you're using a fairly recent servlet-api, this can be achieved by giving MEAT a resources folder as follows:
src/main/resources/META-INF/resources/...
E.g. .../META-INF/resources/flower.jpeg will appear in the deployed WAR as <context root>/flower.jpg (instead of it just being added to the Java class path).

I need a way in order to compile inside the directory LT1_war (using the source that are in the LT_war directory) and packaging using the webapp inside the LT_war directory (just changing the web.xml file)
Generally, you compile from the root. It's not convenient to do what you're asking to do but it can be done by using the --also-make command line option.

Related

Retrieving external .proto files for protoc with protobuf-maven-plugin

Context: My team is working on making our suite of Java services containerized and dynamically scalable. To accomplish this, our plan is to use Envoy backed by etcd, with a custom-build Endpoint Discovery Service as described in the Envoy documentation, using the v2 gRPC-based API. We'll then generate Docker images for each service and deploy/manage them with Kubernetes.
We use Maven as a build system. I'm pretty well versed in Maven, but this is my first time with gRPC or protocol buffers.
I've created a stub for my service using Spring Boot, with Jetty offering some REST and JMX endpoints for management. Before introducing the protobuf stuff, the stub built and ran just fine.
I've downloaded the Envoy data-plane-api and checked the API definition files (**/*.proto) into my project under src/main/proto, keeping the directory structure from the download (e.g. src/main/proto/envoy/api/v2/eds.proto). (Side question: do I need the BUILD files?)
In the end, I'd like a standalone Maven build that can read these files and generate Java classes. The build needs to work on Windows and OS X boxes so that it works for developers, and on Linux boxes so that it works in our CI (Bamboo). It should require nothing more than a JDK, a Maven install, and a Maven repo. (We have an Artifactory instance where I can upload artifacts not otherwise available online, if necessary.)
What I have so far seems like it will accomplish my portability goals:
pom.xml:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>discovery-service</artifactId>
<packaging>jar</packaging>
<name>Discovery Service</name>
<version>1.0.0</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.5.1-1:exe:${os.detected.classifier}</protocArtifact>
<checkStaleness>true</checkStaleness>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<!-- provides os.detected.classifier (i.e. linux-x86_64, osx-x86_64) property -->
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.4.1.Final</version>
</extension>
</extensions>
</build>
<dependencies>
<dependency>
<groupId>io.hydrosphere</groupId>
<artifactId>envoy-data-plane-api_2.11</artifactId>
<version>v1.5.0_1</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.9.1</version>
</dependency>
<!--Unrelated deps (Spring Boot, Jetty, logging, etc) omitted for brevity -->
</dependencies>
</project>
When I build this project using mvn compile, Maven correctly downloads protoc and invokes it, but protoc errors because it can't find some external dependencies:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.classifier: osx-x86_64
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Discovery Service 1.0.0
[INFO] ------------------------------------------------------------------------
Downloading: http://devutl1.sircon.com:8081/artifactory/libs-snapshot/org/glassfish/javax.el/maven-metadata.xml
Downloading: http://devutl1.sircon.com:8081/artifactory/libs-release/org/glassfish/javax.el/maven-metadata.xml
Downloaded: http://devutl1.sircon.com:8081/artifactory/libs-release/org/glassfish/javax.el/maven-metadata.xml (882 B at 547 B/s)
Downloaded: http://devutl1.sircon.com:8081/artifactory/libs-snapshot/org/glassfish/javax.el/maven-metadata.xml (882 B at 547 B/s)
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (default-cli) # discovery-service ---
[INFO]
[INFO] --- protobuf-maven-plugin:0.5.1:compile (default) # discovery-service ---
[INFO] Compiling 56 proto file(s) to /Users/jrobb/Projects/vertabrae/trunk/scaling/discovery-service/target/generated-sources/protobuf/java
[ERROR] PROTOC FAILED: validate/validate.proto: File not found.
gogoproto/gogo.proto: File not found.
envoy/api/v2/core/address.proto: Import "validate/validate.proto" was not found or had errors.
envoy/api/v2/core/address.proto: Import "gogoproto/gogo.proto" was not found or had errors.
envoy/config/metrics/v2/stats.proto: Import "envoy/api/v2/core/address.proto" was not found or had errors.
envoy/config/metrics/v2/stats.proto: Import "validate/validate.proto" was not found or had errors.
envoy/config/metrics/v2/stats.proto:148:5: "envoy.api.v2.core.Address" is not defined.
envoy/config/metrics/v2/stats.proto:167:5: "envoy.api.v2.core.Address" is not defined.
The output continues, with the same set of errors for each .proto file.
It seems that the crux of the issue is that I don't have validate/validate.proto or gogoproto/gogo.proto, which are imported at the top of (nearly?) every .proto file:
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
It seems to be finding wrappers.proto, which I think is coming from my compile-time Maven dependency on protobuf-java.
I think gogoproto/gogo.proto might be looking for this: https://github.com/gogo/protobuf/blob/master/gogoproto/gogo.proto
I'm totally stumped about where validate/validate.proto is supposed to come from. I've seen some evidence that it's specific to Envoy, but I can't find it.
I've spent the last few hours searching, and I'm coming up empty on anyone who's done this before. Where do I get those files? If I can't get them from Maven Central, I'll build them myself and upload to Artifactory.
My eyes are glazing over looking at documentation intended for people using other tech stacks, and I'm having trouble translating for my needs. Any and all help will be much appreciated, and I apologize if this is a hugely n00bish question. :)
Once again, the mere act of asking on SO has led me to the answer; found while adding context and detail to my question. There's a brand-new Java port of the Go-based Envoy control-plane: java-control-plane!
Somebody who, like me, would prefer to just depend on something from Maven Central, and already knew what they were looking for reported this issue, and while I was writing up this question, the maintainer answered: exactly that is coming soon!
I'm pleased to find that api/pom.xml in java-control-plane looks very similar to what I posted in my question. :)
So, if you find yourself in my situation, wanting to implement a Discovery Service for Envoy on a Java tech stack, java-control-plane is already there -- you just have to extend it with whatever backing store you want to use. I assume that, over time, implementations for that will pop up in the community as well. I'll be writing one for etcd and might end up contributing it back to the community.
Answering the finer details of my question:
Where do I get the two .proto file dependencies not included in data-plane-api?
They are in the java-control-plane source: they're checked in as part of the api module's source code, and therefore presumably not available as a separate dependency. I'm reasonably confident that the gogo.proto I found was the right one, but I'm still unclear on where I could have found validate.proto.
Do I need to include the BUILD files from data-plane-api in order to compile the *.proto files with protoc?
Nope! The api module in java-control-plane doesn't include them.

Create an EAR using Maven

I want to create an EAR using Maven, but since I'm in a pure Tycho world, I can't use the maven-ear-plugin, just the maven-assembly-plugin (which is fine).
There are multiple questions even on this very site that indicate that the maven-assembly-plugin can build EARs, even though the documentation says no.
However, when I use define the EAR format like this:
<formats>
<format>ear</format>
</formats>
I get the following exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.0:single (make-assembly) on project org.acme.application: Failed to create assembly: Error creating assembly archive default: appxml attribute is required -> [Help 1]
(I tried a couple of versions for the maven-assembly-plugin, so it's not that.)
Since a EAR is just a renamed JAR, I'm now using the JAR format and this other Maven plug-in:
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>rename-ear</id>
<phase>verify</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<sourceFile>${basedir}/target/${earName}.jar</sourceFile>
<destinationFile>${basedir}/target/${earName}.ear</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
Which works nicely in creating an EAR, however with mvn install it brings the following exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project org.acme.application: Failed to install artifact group:org.acme.application:jar:1.9.126-SNAPSHOT: C:\workspace\Application\target\Application.jar (Das System kann die angegebene Datei nicht finden) -> [Help 1]
(It's German for "Cannot find file", one day I'll get him to print out readable error messages.)
Of course, now I could copy the JAR to an EAR instead of just renaming it, but I thought I get a 2nd oppinion first: Is it possible to create an EAR with the maven-assembly-plugin? If so, how?

Vaadin Custom Components/Widgets with Maven and Spring Boot

I am relatively new to vaadin and started out with a spring boot application and the vaadin spring boot plugin. Everything worked fine until I got to the point where I tried to create my own components/widgets.
Unfortunately I didn't find any "official" example/documentation how to set up custom components within a spring boot application so I had to search the web to find out how to set up additional plugin(s) in maven to compile the code for the client side widgets. As far as I can tell from the log output the compilation of these components work, but when I try to access these components on the webpage I get an error:
Widgetset 'com.vaadin.DefaultWidgetSet' does not contain implementation for net.gtidev.test.components.MyComponent. Check its component connector's #Connect mapping, widgetsets GWT module description file and re-compile your widgetset. [...]
Here is the widget compiler log:
[INFO] Using com.vaadin:vaadin-client-compiler version 7.6.4
[ERROR] Mar 22, 2016 10:22:43 AM java.util.prefs.WindowsPreferences <init>
[ERROR] WARNUNG: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[INFO] Compiling module net.gtidev.test.components.TestWidgetset
[INFO] Computing all possible rebind results for 'com.vaadin.client.metadata.ConnectorBundleLoader'
[INFO] Rebinding com.vaadin.client.metadata.ConnectorBundleLoader
[INFO] Invoking generator com.vaadin.server.widgetsetutils.ConnectorBundleLoaderFactory
[INFO] Populating eager bundle
. . . . . 250 more lines
[INFO] Computing all possible rebind results for 'com.vaadin.client.ui.dd.VAcceptCriterionFactory'
[INFO] Rebinding com.vaadin.client.ui.dd.VAcceptCriterionFactory
[INFO] Invoking generator com.vaadin.server.widgetsetutils.AcceptCriteriaFactoryGenerator
[INFO] Detecting available criteria ...
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.AcceptAll
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.And
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.SourceIs
[INFO] creating mapping for com.vaadin.ui.AbstractSelect.TargetItemIs
[INFO] creating mapping for com.vaadin.ui.AbstractSelect.AcceptItem
[INFO] creating mapping for com.vaadin.ui.Table.TableDropCriterion
[INFO] creating mapping for com.vaadin.ui.Tree.TreeDropCriterion
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.Not
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.Or
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.ServerSideCriterion
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.SourceIsTarget
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.TargetDetailIs
[INFO] creating mapping for com.vaadin.ui.Tree.TargetInSubtree
[INFO] Done. (0seconds)
[INFO] Compiling 1 permutation
[INFO] Compiling permutation 0...
[INFO] Compile of permutations succeeded
[INFO] Compilation succeeded -- 59,217s
[INFO] Linking into C:\projects\misc\vaadin-boot\target\vaadin-boot-0.0.1-SNAPSHOT\net.gtidev.test.components.TestWidgetset
[INFO] Link succeeded
[INFO] Linking succeeded -- 0,492s
The files I use for my custom component were generated by the eclipse vaadin addon within a vaadin 7 project which I created only for this purpose. When I started this vaadin 7 project in eclipse the component worked. I then copied these files into my spring boot maven project where the custom component does not get loaded any more.
I know that spring boot applications have a slightly different bootstrap mechanism and layout than "classic" webapps and that amongst other things static resources are not loaded from the webapp-folder but from the classpath:/static folder. I think that the core of the problem has something to do with this fact but I don't know what to do to fix it.
My Plugin configuration (I tried with and without the commented options):
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>7.6.4</version>
<configuration>
<strict>true</strict>
<force>true</force>
<!-- Enable during development to speed compiling. -->
<!-- <draftCompile>true</draftCompile>
<style>DETAILED</style> -->
<!-- End development options -->
<!--<webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>-->
<modules>
<module>net.gtidev.test.components.TestWidgetset</module>
</modules>
</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
I tried different maven plugin combinations and configurations. In one example, there was also a Google-GWT Plugin mentioned, but running this plugin on the code produced the same log output as the vaadin plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<!--<configuration>-->
<!--<webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>-->
<!--<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>-->
<!--<runTarget>clean</runTarget>-->
<!--<hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>-->
<!--<noServer>true</noServer>-->
<!--<port>8080</port>-->
<!--<soycDetailed>false</soycDetailed>-->
<!--</configuration>-->
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
To use custom client side extensions, Vaadin Add-ons, you'll need to add vaadin-maven-plugin to your project. It will scan the add-ons you use and GWT compile a new widgetset for your project that contains those extensions.
If you created the project with start.spring.io the maven plugin is not in your project by default. Create an example project for example using this Vaadin+Spring archetype or the official servlet based archetype and copy the vaadin-maven-plugin related parts from the pom.xml to your projects pom.xml. Then do a full build and everything should works as expected.

Got NoClassDefFoundError when invoking Axis2 webservice deployed with maven in weblogic

I'm trying to deploy axis2 webservices in weblogic server using maven. The project has maven modules and one of that is a war that i have defined the axis servlet in. The wsdl was there, so i used wsdl2code plugin to generate the xmlbean and schema and put that in a jar module. Structure is as below.
--lv-ear (ear with dependency on war)
|
--lv-ws
|
--lv-ws-ccid (jar module with skeleton and xmlbeans)
|
--lv-ws-ecs (jar module with skeleton and xmlbeans)
|
--lv-ws-web (war module with dep on jar modules)
|
--WEB-INF
|
--conf/axis2.xml
--services/ccid/services.xml
I built and deployed the ear to weblogic domain. The war was deployed successfully as part of ear and services were deployed. I am able to access wsdl files. When I tried to call the service, i got the below ClassNotFoundException for a schema file.
Caused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s2104B1E6E09A2A85656B3E630BA151C1.TypeSystemHolder
I saw that the random string in that path differed fo me. So I tried to call again and got below NoClassDefFoundError, which persists even after I tried with different approaches.
java.lang.NoClassDefFoundError: Could not initialize class com.lv.ws.ccid.xmlbean.InputDocument
at com.lv.ws.ccid.xmlbean.InputDocument$Factory.parse(InputDocument.java:463)
at com.lv.ws.ccid.CcidMessageReceiverInOut.fromOM(CcidMessageReceiverInOut.java:332)
at com.lv.ws.ccid.CcidMessageReceiverInOut.invokeBusinessLogic(CcidMessageReceiverInOut.java:46)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
I searched for this and found something that told to configure app server for axis2 based on http://axis.apache.org/axis2/java/core/docs/app_server.html . When I tried it I got below error.
weblogic.xml.stax.XmlStreamInputFactory can not be cast to javax.xml.stream.XmlInputFactory
After discarding that configuration, I did some other possible deployments by having the webservice skeleton and xmlbean files in an aar and put the aar inside WEB-INF/services. I also tried putting Class-Path entry in MANIFEST.MF in ear / war for the jar files, to no avail. Still I got the same NoClassDefFoundError. Can you please give me suggestions on fixing that?
Fixed it now. This was due to my lack of experience with Axis. Issue was that, I had the generated schema and xmlbean files moved to src folder and then just tried to use normal jar function and dependency to deploy.
Now, I removed them from src folder and use wsdl2code and axis2-aar plugins to generate the xmlbean and schema files dynamically and then package them in aar. Then I deployed the aar to webapp and it worked fine. I have listed the plugin configuration inside <build> below.
<plugins>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<version>1.5.4</version>
<executions>
<execution>
<id>ccid-ws</id>
<goals>
<goal>wsdl2code</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>com.lv.ws.ccid</packageName>
<wsdlFile>${basedir}/src/main/resources/META-INF/ccid.wsdl</wsdlFile>
<databindingName>xmlbeans</databindingName>
<syncMode>sync</syncMode>
<unpackClasses>true</unpackClasses>
<namespaceToPackages>https://mdm.com/portal/ws/services/ccid=com.lv.ws.ccid.xmlbean</namespaceToPackages>
<outputDirectory>${basedir}/target/generated-sources</outputDirectory> <generateServerSide>false</generateServerSide>
<generateServicesXml>true</generateServicesXml>
<skipWSDL>true</skipWSDL>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-aar-maven-plugin</artifactId>
<version>1.6.2</version>
<extensions>true</extensions>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>aar</goal>
</goals>
</execution>
</executions>
<configuration>
<aarName>ccid</aarName>
<includeDependencies>false</includeDependencies>
<outputDirectory>${project.build.directory}/aar</outputDirectory>
</configuration>
</plugin>
</plugins>

maven-pmd-plugin external custom ruleset doesn't work

I'm using this in my pom in the reporting section:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.7.1</version>
<configuration>
<rulesets>
<ruleset>http://serverxxx/pmd-java.xml</ruleset>
</rulesets>
<targetJdk>1.6</targetJdk>
</configuration>
</plugin>
somehow it doesn't work. When I use the rules directly instead of a custom ruleset via http it work fine. I use pmd:pmd and the section is also in the build section of the pom...
Logs:
16:11:05 [INFO] --- maven-pmd-plugin:2.7.1:cpd (default-cli) # online-news ---
16:11:05 mojoSucceeded org.apache.maven.plugins:maven-pmd-plugin:2.7.1(default-cli)
16:11:05 [DRY] Finding all files that match the pattern cpd.xml
16:11:05 [DRY] Parsing 1 files in D:\build\hudson\jobs\xxx migration-maven-3 CI\workspace\migration-maven-3\application\online-modules\online-news\target
16:11:06 [DRY] Successfully parsed file D:\build\hudson\jobs\xxx migration-maven-3 CI\workspace\migration-maven-3\application\online-modules\online-news\target\cpd.xml of module News with 31 warnings.
16:11:06 [DRY] Computing warning deltas based on reference build #13
16:11:06 mojoStarted org.codehaus.mojo:findbugs-maven-plugin:2.5.2(default-cli)

Resources