Maven build throws java.lang.ClassNotFoundException during tests performing [duplicate] - java

This question already has answers here:
JUnit 5 test case not executed
(2 answers)
Closed 5 years ago.
I have spring-boot project with integration tests. I'm trying to move to JDK 9. After some changes in pom I'm able to build (with tests skipped) and run project on java 9. But when I try to perform integration tests, I get an exception:
mvn clean install:
[ERROR] Please refer to pathToProject\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] java.lang.ClassNotFoundException: org.apache.maven.surefire.junit4.JUnit4Provider
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] java.lang.ClassNotFoundException: org.apache.maven.surefire.junit4.JUnit4Provider
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:673)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:535)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:280)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:955)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
My 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>
<artifactId>myProject</artifactId>
<version>0.1.4</version>
<packaging>jar</packaging>
<groupId>com.myProject</groupId>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<properties>
<java.version>1.9</java.version>
<!-- Dependency versions -->
<logback.version>1.1.7</logback.version>
<lombok.version>1.16.18</lombok.version>
<!-- Plugin versions-->
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>2.20.1</maven-failsafe-plugin.version>
<docker-maven-plugin.version>1.0.0</docker-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<!-- tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<jdkToolchain>
<version>9</version>
</jdkToolchain>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>--add-modules java.se.ee</argLine>
<argLine>--add-modules java.xml.bind</argLine>
<argLine>--add-modules java.xml.ws.annotation</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
</plugins>
</build>
</project>
Maven version: 3.5.2
All integration tests have the same configuration:
#RunWith(SpringRunner.class)
#SpringBootTest
#TestPropertySource(locations="classpath:application.properties")
public class SomeTest {

The problem was in maven-surefire-plugin version 2.20.1. It is not working for me even on JDK 8. After decreasing version to 2.18.1, it started to work fine.

Related

Maven including non-defined dependencies

My Maven is failing with the following error:
[ERROR] Failed to execute goal on project sdcf4j-twitch: Could not resolve dependencies for project com.github.twitch4j:sdcf4j-twitch:jar:1.0.9: Failed to collect dependencies at com.github.twitch4j:twitch4j:jar:v0.10.2 -> org.projectlombok:lombok:jar:+: Failed to read artifact descriptor for org.projectlombok:lombok:jar:+: Could not transfer artifact org.projectlombok:lombok:pom:+ from/to jitpack.io (https://jitpack.io): Transfer failed for https://jitpack.io/org/projectlombok/lombok/+/lombok-+.pom 400 Bad Request -> [Help 1]
I already tried completely wiping Intellij IDEA's files, and re-adding the dependencies, which didn't help with the error, but some wrong dependencies, that my IDE displayed.
Of course I already tried without any lombok plugin, (lombok) annotation paths and a mvn clear, but that didn't help either.
The Maven code for that project is the following:
<?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>
<parent>
<groupId>de.btobastian.sdcf4j</groupId>
<artifactId>sdcf4j</artifactId>
<version>1.0.9</version>
</parent>
<groupId>com.github.twitch4j</groupId>
<artifactId>sdcf4j-twitch</artifactId>
<version>1.0.9</version>
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
</path>
</annotationProcessorPaths>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Include source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.0.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Include JavaDocs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<stylesheet>java</stylesheet>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- The core module -->
<dependency>
<groupId>de.btobastian.sdcf4j</groupId>
<artifactId>sdcf4j-core</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.twitch4j</groupId>
<artifactId>twitch4j</artifactId>
<version>v0.10.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
The Parent Pom does not differ from the original at https://github.com/Bastian/sdcf4j/blob/8f569ee5dc36be09c6595c12833d109b7127c23e/pom.xml.
If one sets up the folders correctly, you can add sdcf4j-twitch as a module in sdcf4j, just like sdcf4j-core,sdcf4j-discord4j in L17
Complete Build log:
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< com.github.twitch4j:sdcf4j-twitch >------------------
[INFO] Building sdcf4j-twitch 1.0.9
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from jitpack.io: https://jitpack.io/org/projectlombok/lombok/+/lombok-+.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.968 s
[INFO] Finished at: 2020-12-10T22:55:31+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sdcf4j-twitch: Could not resolve dependencies for project com.github.twitch4j:sdcf4j-twitch:jar:1.0.9: Failed to collect dependencies at com.github.twitch4j:twitch4j:jar:v0.10.2 -> org.projectlombok:lombok:jar:+: Failed to read artifact descriptor for org.projectlombok:lombok:jar:+: Could not transfer artifact org.projectlombok:lombok:pom:+ from/to jitpack.io (https://jitpack.io): Transfer failed for https://jitpack.io/org/projectlombok/lombok/+/lombok-+.pom 400 Bad Request -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project grpc_hello_server: Compilation failure

I'm trying to create a gRPC service with Java using below codelab.
I created a sample proto file. While compiling the .proto using maven, i got a build failure error. It says javax.annotation.Generated anottation class is not found.
Could you help me find the root cause of the issue and steps to fix it. I feel it should be a versioning issue but not clear on how to solve it.
https://codelabs.developers.google.com/codelabs/cloud-grpc-java/index.html?index=..%2F..index#2
Errors:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/grpc_hello_server/target/generated-sources/protobuf/grpc-java/com/example/grpc/GreetingServiceGrpc.java:[20,18] cannot find symbol
symbol: class Generated
location: package javax.annotation
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.845 s
[INFO] Finished at: 2020-06-29T16:56:21-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project grpc_hello_server: Compilation failure
[ERROR] /home/grpc_hello_server/target/generated-sources/protobuf/grpc-java/com/example/grpc/GreetingServiceGrpc.java:[20,18] cannot find symbol
[ERROR] symbol: class Generated
[ERROR] location: package javax.annotation
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException.
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.grpc</groupId>
<artifactId>grpc_hello_server</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>grpc_hello_server</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.6.2</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.4.0:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.7.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Issue is due to missing dependency in pom.xml for Java 9+
<dependency> <!-- necessary for Java 9+ -->
<groupId>org.apache.tomcat</groupId>
<artifactId>annotations-api</artifactId>
<version>6.0.53</version>
<scope>provided</scope>
</dependency>
Any reason you are using Java 1.6?
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
Can you change it to 1.7 and see if it works?

Classes from WSDL aren't auto-generated by CXF

I'm trying to port a SOAP consuming application to JAVA. I'm having issues making cxf-codegen-plugin to read the WSDL, which is from a third party and it actually works. I'm guessing that the issue is that the WSDL is not fully compliant with the standard and CXF can't complete the parsing.
Following for example the tutorial at http://www.littlebigextra.com/consume-secure-soap-web-service-spring-boot-application/, I can succesfully parse the following WSDLs https://osetesting.bizlinks.com.pe/ol-ti-itcpe/billService?wsdl and https://test.conose.pe/ol-ti-itcpe/billService.svc, but can't process https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl, which would be funny if I weren't stuck in this issue, since the last one is SUPPOSED to be the reference for the first two.
I have also tried the SpringBoot tutorial at https://spring.io/guides/gs/consuming-web-service/, it doesn't raise an error, but it doesn't create the classes as well
Here is my pom (taken from http://www.littlebigextra.com/consume-secure-soap-web-service-spring-boot-application/)
<?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>test.wsdl</groupId>
<artifactId>test-sunat-soap-ws</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<cxf.version>3.1.10</cxf.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-policy</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-tools-common</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-security</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<additionalJvmArgs>
-Djavax.xml.accessExternalDTD=all
-Djavax.xml.accessExternalSchema=all
</additionalJvmArgs>
<sourceRoot>${basedir}/src/main/generated</sourceRoot>
<wsdlOptions>
<wsdlOption>
<extraargs>
<extraarg>-verbose</extraarg>
<extraarg>-p</extraarg>
<extraarg>sunat.generated</extraarg>
<extraarg>-exsh</extraarg>
<extraarg>true</extraarg>
</extraargs>
<!--<wsdl>https://osetesting.bizlinks.com.pe/ol-ti-itcpe/billService?wsdl</wsdl>-->
<!--<wsdl>https://test.conose.pe/ol-ti-itcpe/billService.svc</wsdl>-->
<wsdl>https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
When I run mvn generate-sources, I can see that is calling the wsdl2java tool
wsdl2java -encoding UTF-8 -d C:\dev-tools\testbizlinksgetstatuscdr\src\main\generated -verbose -p sunat.generated -exsh true https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl
However, I get the following stacktrace
org.apache.cxf.tools.common.ToolException: java.io.IOException: Server returned HTTP response code: 503 for URL: https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?ns1.wsdl
at org.apache.cxf.tools.validator.internal.Stax2DOM.getDocument(Stax2DOM.java:64)
at org.apache.cxf.tools.validator.internal.Stax2DOM.getDocument(Stax2DOM.java:47)
at org.apache.cxf.tools.validator.internal.WSDLRefValidator.getWSDLDocument(WSDLRefValidator.java:168)
at org.apache.cxf.tools.validator.internal.WSDLRefValidator.getWSDLDocuments(WSDLRefValidator.java:185)
at org.apache.cxf.tools.validator.internal.WSDLRefValidator.isValid(WSDLRefValidator.java:231)
at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:134)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:207)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:201)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:414)
at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:279)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:511)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?ns1.wsdl
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at java.net.URL.openStream(URL.java:1045)
at org.apache.cxf.tools.validator.internal.Stax2DOM.getDocument(Stax2DOM.java:59)
... 37 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.681 s
[INFO] Finished at: 2019-07-18T15:21:38-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.3.2:wsdl2java (generate-sources) on project test-bizlinks-getstatuscdr: Execution generate-sources of goal org.apache.c
xf:cxf-codegen-plugin:3.3.2:wsdl2java failed:
[ERROR] Summary: Failures: 14, Warnings: 0
[ERROR]
[ERROR] <<< ERROR!
[ERROR] null
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[29,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendSummary][output:sendSummaryResponse] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[27,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendSummary][input:sendSummaryRequest] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[25,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendSummary] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[23,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendPack][output:sendPackResponse] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[21,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendPack][input:sendPackRequest] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[19,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendPack] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[17,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendBill][output:sendBillResponse] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[15,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendBill][input:sendBillRequest] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[13,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:sendBill] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[11,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:getStatus][output:getStatusResponse] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[9,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:getStatus][input:getStatusRequest] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[7,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService][operation:getStatus] not exist.
[ERROR] https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl:[5,1]
[ERROR] Caused by {http://service.sunat.gob.pe}[portType:billService] not exist.
[ERROR]
[ERROR] -> [Help 1]
Edited: I included the whole error output, since I realized there were additional errors after the stacktrace
The line 503 for URL: https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?ns1.wsdl is what makes me think that the WSDL is not fully compliant (because of the ?ns1.wsdl param, instead of just ?wsdl) However, if I try to access that link, I do get the same WSDL as if I used the original link, so I don't understand the 503 error at all.
When I run the code from the second tutorial, I get the following messages
[INFO] --- maven-jaxb2-plugin:0.12.3:generate (default) # sunat-consuming-web-service ---
[INFO] Up-to-date check for source resources [[https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl, file:/C:/dev-tools/sunatconsumingwebservice/pom.xml]] and taret resource
s [[]].
[WARNING] The URI [https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl] seems to represent an absolute HTTP or HTTPS URL. Getting the last modification timestamp is only po
ssible if the URL is accessible and if the server returns the [Last-Modified] header correctly. This method is not reliable and is likely to fail. In this case the last modification time
stamp will be assumed to be unknown.
[ERROR] Could not retrieve the last modification timestamp for the URI [https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl] from the HTTP URL connection. The [Last-Modifie
d] header was probably not set correctly.
[WARNING] Last modification of the URI [https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService?wsdl] is not known.
[INFO] Sources are not up-to-date, XJC will be executed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Cool, no error... but also no classes at all. When I use any of the other two URLs, the classes are generated at target/xjc/sunat.wsdl, showing exactly the same messages.
I tried using verbose, with mvn generate-sources -X, but apart of showing additional messages about the settings, no errors or more information of why the classes aren't generated appears.
How can I get either code to generate the classes for the WS?

java.lang.VerifyError when using WCMUsePojo in a simple AEM application

Below is the error which I get when I do a mvn clean install of the project. It is a simple AEM application in AEM 6.1 where i am trying to use WCMUse.
[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr (gene
rate-scr-descriptor) on project myproject-bundle: Execution generate-scr-descrip
tor of goal org.apache.felix:maven-scr-plugin:1.7.4:scr failed: An API incompati
bility was encountered while executing org.apache.felix:maven-scr-plugin:1.7.4:s
cr: java.lang.VerifyError: Constructor must call super() or this() before return
[ERROR] Exception Details:
[ERROR] Location:
[ERROR] com/adobe/cq/sightly/WCMUsePojo.<init>()V #1: return
[ERROR] Reason:
[ERROR] Error exists in the bytecode
[ERROR] Bytecode:
[ERROR] 0x0000000: 2ab1
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.felix:maven-scr-plugin:1.7.4
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/Maven_Repo/org/apache/felix/maven-scr-plugin/1.7.4/ma
ven-scr-plugin-1.7.4.jar
[ERROR] urls[1] = file:/D:/Maven_Repo/org/apache/maven/maven-archiver/2.2/maven-
archiver-2.2.jar
[ERROR] urls[2] = file:/D:/Maven_Repo/org/codehaus/plexus/plexus-utils/1.0.4/ple
xus-utils-1.0.4.jar
[ERROR] urls[3] = file:/D:/Maven_Repo/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[4] = file:/D:/Maven_Repo/org/codehaus/plexus/plexus-archiver/1.0-al
pha-7/plexus-archiver-1.0-alpha-7.jar
[ERROR] urls[5] = file:/D:/Maven_Repo/org/apache/felix/org.apache.felix.scr.gene
rator/1.1.4/org.apache.felix.scr.generator-1.1.4.jar
[ERROR] urls[6] = file:/D:/Maven_Repo/com/thoughtworks/qdox/qdox/1.12/qdox-1.12.
jar
[ERROR] urls[7] = file:/D:/Maven_Repo/asm/asm-all/3.1/asm-all-3.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>my-group-id:myprojec
t-bundle:1.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContaine
rException
Below is the code where i am using WCMUsePojo.
package com.mycompany.myproject.controllers;
import com.adobe.cq.sightly.WCMUsePojo;;
public class TestController extends WCMUsePojo{
#Override
public void activate() throws Exception {
// TODO Auto-generated method stub
testMethod();
}
void testMethod()
{
System.out.println("test method");
}
}
If I remove extends WCMUsePojo there is no error and the build runs fine.
Please find below the pom which I am using:
<?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>
<!-- ====================================================================== -->
<!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<parent>
<groupId>my-group-id</groupId>
<artifactId>myproject</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<!-- ====================================================================== -->
<!-- P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<artifactId>myproject-bundle</artifactId>
<packaging>bundle</packaging>
<name>My Project Bundle</name>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
</dependency>
<dependency>
<groupId>biz.aQute</groupId>
<artifactId>bndlib</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.jcr.api</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.1.0</version>
<classifier>obfuscated-apis</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
<!-- ====================================================================== -->
<!-- B U I L D D E F I N I T I O N -->
<!-- ====================================================================== -->
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<executions>
<execution>
<id>generate-scr-descriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>my-group-id.myproject-bundle</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<configuration>
<slingUrl>http://${crx.host}:${crx.port}/apps/myproject/install</slingUrl>
<usePut>true</usePut>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<excludePackageNames>
*.impl
</excludePackageNames>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>auto-deploy</id>
<build>
<plugins>
<!-- Use the sling plugin to automatically deploy the bundle to the
JCR tree -->
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<executions>
<execution>
<id>install-bundle</id>
<goals>
<goal>install</goal>
</goals>
<configuration>
<slingUrl>http://${cq.host}:${cq.port}</slingUrl>
<slingUrlSuffix>/apps/myproject/install</slingUrlSuffix>
<user>${cq.user}</user>
<password>${cq.password}</password>
<usePut>true</usePut>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
This is mainly because of obfuscated uber-jar which provides only interfaces of the dependent classes, while WcmUsePojo is a class and not interface you see this issue. One way to resolve this is to either get unobfuscated jar for Adobe and use it, another is to explicitly add the sightly dependencies to your pom. You can check the version number and other details from your bundles console. In your case you would need only com.adobe.cq.sightly.cq-wcm-sightly-extension bundle as dependency in your POM

maven jboss-as:start A required class was missing ... org/sonaty.../ArtifactResolutionException

I am attempting to start a jboss-as server using the mvn jboss-as:start command and simply put it won't run.
http://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:start (default-cli) on project thenaglecode: Execution default-cli of goal org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:start failed: A required class was missing while executing org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final:start: org/sonatype/aether/resolution/ArtifactResolutionException
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.4.Final
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/jxnagl/.m2/repository/org/jboss/as/plugins/jboss-as-maven-plugin/7.4.Final/jboss-as-maven-plugin-7.4.Final.jar
[ERROR] urls[1] = file:/C:/Users/jxnagl/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
...
[ERROR] urls[33] = file:/C:/Users/jxnagl/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar
[ERROR] urls[34] = file:/C:/Users/jxnagl/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.sonatype.aether.resolution.ArtifactResolutionException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
This link: '[Help 1]' from the above error log at the bottom of the trace shows that this issue is very new, not more than a day old.
the page however is not very useful to me, maybe because i am new to maven so please be nice to me, i.e. i can't figure out what dependency is failing.
Here is my pom.xml for your perusal, forgive the overkill on properties, i'm going to revert this way of doing things soon.
<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.thenaglecode</groupId>
<artifactId>thenaglecode</artifactId>
<packaging>pom</packaging>
<version>1.0.0.Pre-Alpha</version>
<modules>
<module>core</module>
<module>algorithms</module>
<module>web</module>
<module>testing</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- the nagle code properties -->
<thenaglecode.java.compiler.version>1.7</thenaglecode.java.compiler.version>
<thenaglecode.java.home>C:\Program Files\Java\jdk1.7.0_25</thenaglecode.java.home>
<thenaglecode.version>1.0.0.Pre-Alpha</thenaglecode.version>
<!-- third party library versions format: "libraries.version.<groupid>.<artifactid>" -->
<libraries.version.org.jboss.spec.jboss-javaee-6.0>3.0.2.Final
</libraries.version.org.jboss.spec.jboss-javaee-6.0>
<libraries.version.org.jboss.spec.jboss-javaee-all-6.0>3.0.2.Final
</libraries.version.org.jboss.spec.jboss-javaee-all-6.0>
<libraries.version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final
</libraries.version.org.jboss.as.jboss-as-arquillian-container-remote>
<libraries.version.org.jboss.arqullian.protocol.arquillian-protocol-servlet>1.1.0.Final
</libraries.version.org.jboss.arqullian.protocol.arquillian-protocol-servlet>
<libraries.version.org.jboss.weld.weld-api>2.0.Final</libraries.version.org.jboss.weld.weld-api>
<libraries.version.org.jboss.arquillian.container.arquillian-glassfish-remote-3.1>1.0.0.CR4
</libraries.version.org.jboss.arquillian.container.arquillian-glassfish-remote-3.1>
<libraries.version.org.jboss.spec.javax.servlet.jstl.jboss-jstl-api_1.2_spec>1.0.3.Final
</libraries.version.org.jboss.spec.javax.servlet.jstl.jboss-jstl-api_1.2_spec>
<libraries.version.org.jboss.arquillian.arquillian-bom>1.1.1.Final
</libraries.version.org.jboss.arquillian.arquillian-bom>
<libraries.version.xalan.xalan>2.7.1</libraries.version.xalan.xalan>
<libraries.version.joda-time.joda-time>2.2</libraries.version.joda-time.joda-time>
<libraries.version.junit.junit>4.11</libraries.version.junit.junit>
<libraries.version.org.apache.commons.commons-lang3>3.1</libraries.version.org.apache.commons.commons-lang3>
<libraries.version.commons-collections.commons-collections>3.2.1</libraries.version.commons-collections.commons-collections>
<libraries.version.commons-io.commons-io>2.4</libraries.version.commons-io.commons-io>
<!-- plugins format: "plugins.version.<groupid>.<artifactid>" -->
<plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>7.4.Final</plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>
<plugins.version.org.apache.maven.plugins.maven-compiler-plugin>3.1</plugins.version.org.apache.maven.plugins.maven-compiler-plugin>
<plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>7.4.Final</plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin>
</properties>
<dependencyManagement>
<dependencies>
<!-- thenaglecode projects -->
<dependency>
<groupId>com.thenaglecode</groupId>
<artifactId>core</artifactId>
<version>${thenaglecode.version}</version>
</dependency>
<dependency>
<groupId>com.thenaglecode</groupId>
<artifactId>web</artifactId>
<version>${thenaglecode.version}</version>
</dependency>
<dependency>
<groupId>com.thenaglecode</groupId>
<artifactId>algorithms</artifactId>
<version>${thenaglecode.version}</version>
</dependency>
<!-- third party libraries -->
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${libraries.version.org.jboss.arquillian.arquillian-bom}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-all-6.0</artifactId>
<version>${libraries.version.org.jboss.spec.jboss-javaee-all-6.0}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${libraries.version.org.apache.commons.commons-lang3}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${libraries.version.commons-collections.commons-collections}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${libraries.version.commons-io.commons-io}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${libraries.version.junit.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet.jstl</groupId>
<artifactId>jboss-jstl-api_1.2_spec</artifactId>
<version>${libraries.version.org.jboss.spec.javax.servlet.jstl.jboss-jstl-api_1.2_spec}</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>${libraries.version.xalan.xalan}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${libraries.version.joda-time.joda-time}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugins.version.org.apache.maven.plugins.maven-compiler-plugin}</version>
<configuration>
<source>${thenaglecode.java.compiler.version}</source>
<target>${thenaglecode.java.compiler.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin}</version>
<configuration>
<javaHome>${thenaglecode.java.home}</javaHome>
<execute-commands/>
<executeCommands/>
</configuration>
</plugin>
</plugins>
</build>
</project>
With Maven 3.1 they switched to using eclipse aether. The jboss-as-maven-plugin uses Sonatype aether as that us what Maven 3.0.x uses. The two versions are not compatible meaning it would require two different plugins would be required. One for Maven 3.1 and one for Maven 3.0.x.
One note is, as you've seen, this only affects the run and start goals. There is no workaround for it. You have to use Maven 3.0.x until a release of the jboss-as-maven-plugin is released that will support eclipse aether.
As far as I understand this bug report : jboss-as-maven-plugin have 2 dependencies on incompatible maven plugin (dependency-plugin and enforcer-plugin).
As a workaround, I would try the following : override incompatible dependencies with newer versions known to be compatible (listed here). To do so : change your pom.xml and add the following dependencies for jboss-as-maven-plugin (i.e. NOT your project dependencies)
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${plugins.version.org.jboss.as.plugins.jboss-as-maven-plugin}</version>
<configuration>
<javaHome>${thenaglecode.java.home}</javaHome>
<execute-commands/>
<executeCommands/>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version> <!--override 2.6-->
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3</version> <!--override 1.2-->
</dependency>
</dependencies>
</plugin>

Categories

Resources