{"id":20678215,"url":"https://github.com/codecentric/cxf-spring-boot-starter-maven-plugin","last_synced_at":"2025-04-19T21:17:38.498Z","repository":{"id":8242285,"uuid":"57193573","full_name":"codecentric/cxf-spring-boot-starter-maven-plugin","owner":"codecentric","description":"Maven plugin complementing cxf-spring-boot-starter","archived":false,"fork":false,"pushed_at":"2024-10-21T16:42:05.000Z","size":148,"stargazers_count":20,"open_issues_count":18,"forks_count":13,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-22T05:31:30.539Z","etag":null,"topics":["cxf","jax-ws","soap","spring-boot","wsdl","xsd"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecentric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-27T07:36:40.000Z","updated_at":"2022-05-11T01:02:52.000Z","dependencies_parsed_at":"2022-09-08T11:50:49.955Z","dependency_job_id":"7607160b-8578-45d9-a4ea-d7e2b93530ad","html_url":"https://github.com/codecentric/cxf-spring-boot-starter-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fcxf-spring-boot-starter-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fcxf-spring-boot-starter-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fcxf-spring-boot-starter-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fcxf-spring-boot-starter-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecentric","download_url":"https://codeload.github.com/codecentric/cxf-spring-boot-starter-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249806187,"owners_count":21327908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cxf","jax-ws","soap","spring-boot","wsdl","xsd"],"created_at":"2024-11-16T21:19:27.294Z","updated_at":"2025-04-19T21:17:38.438Z","avatar_url":"https://github.com/codecentric.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"cxf-spring-boot-starter-maven-plugin complementing cxf-spring-boot-starter\n=============================\n[![Build Status](https://github.com/codecentric/cxf-spring-boot-starter-maven-plugin/workflows/github/badge.svg)](https://github.com/codecentric/cxf-spring-boot-starter-maven-plugin/actions)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.codecentric/cxf-spring-boot-starter-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.codecentric/cxf-spring-boot-starter-maven-plugin/)\n[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n[![renovateenabled](https://img.shields.io/badge/renovate-enabled-yellow)](https://renovatebot.com)\n[![versionjaxb](https://img.shields.io/badge/dynamic/xml?color=brightgreen\u0026url=https://raw.githubusercontent.com/codecentric/cxf-spring-boot-starter-maven-plugin/master/cxf-spring-boot-starter-maven-plugin/pom.xml\u0026query=%2F%2A%5Blocal-name%28%29%3D%27project%27%5D%2F%2A%5Blocal-name%28%29%3D%27properties%27%5D%2F%2A%5Blocal-name%28%29%3D%27jaxb.version%27%5D\u0026label=org.glassfish.jaxb)](github.com/eclipse-ee4j/jaxb-ri)\n[![versionjaxws](https://img.shields.io/badge/dynamic/xml?color=brightgreen\u0026url=https://raw.githubusercontent.com/codecentric/cxf-spring-boot-starter-maven-plugin/master/cxf-spring-boot-starter-maven-plugin/pom.xml\u0026query=%2F%2A%5Blocal-name%28%29%3D%27project%27%5D%2F%2A%5Blocal-name%28%29%3D%27properties%27%5D%2F%2A%5Blocal-name%28%29%3D%27jaxws-ri.version%27%5D\u0026label=com.sun.xml.ws.jaxws)](https://mvnrepository.com/artifact/com.sun.xml.ws/jaxws-rt)\n[![versionjava](https://img.shields.io/badge/jdk-8,_11,_15-brightgreen.svg?logo=java)](https://www.oracle.com/technetwork/java/javase/downloads/index.html)\n[![versionjaxws-maven-plugin](https://img.shields.io/badge/jaxws_maven_plugin-3.0.0-brightgreen.svg)](https://github.com/eclipse-ee4j/metro-jax-ws/tree/master/jaxws-ri/extras/jaxws-maven-plugin)\n[![versionspring](https://img.shields.io/badge/dynamic/xml?color=brightgreen\u0026url=https://raw.githubusercontent.com/codecentric/cxf-spring-boot-starter-maven-plugin/master/cxf-spring-boot-starter-maven-plugin/pom.xml\u0026query=%2F%2A%5Blocal-name%28%29%3D%27project%27%5D%2F%2A%5Blocal-name%28%29%3D%27properties%27%5D%2F%2A%5Blocal-name%28%29%3D%27spring.version%27%5D\u0026label=spring)](https://spring.io/)\n\n\nWhile a spring-boot-starter like [cxf-spring-boot-starter] generally only serves as a Maven dependency, something that will be executed in the build-section is not delivered in such a way. But the generation of JAX-B Classfiles is a good candidate to run inside the build-process - so the resulting files aren´t checked into source control system. The configuration e.g. of the [jaxws-maven-plugin] is rather complex to work properly and one has to do some research, till all necessary configuration parameters are set properly ([something like this](https://github.com/jonashackt/soap-spring-boot-cxf/blob/master/pom.xml) has to be done - just have a look into the build section of the pom).\n\n### Features include:\n\n* Generating all necessary Java-Classes using JAX-B from your WSDL/XSDs, complementing the [cxf-spring-boot-starter]\n* This also works for complex imports of many XSD files that inherit other XSDs themselves\n* The generated JAX-B Classfiles will be added to your projects classpath - ready to map \u0026 transform into whatever you want\n* Scanning your resource-Folder for the WSDL and configuring the jaxws-maven-plugin, so that non-absolute paths will be generated into @WebServiceClient-Class\n* Non-absolute paths will be generated into @WebService and @WebServiceClient-Classes (so that one can initialize the Apache CXF endpoint 100% contract-first)\n* Extract the targetNamespace from the WSDL, generate the SEI and WebServiceClient annotated classes package names from it \u0026 write it together with the project´s package name into a cxf-spring-boot-maven.properties to enable Complete automation of Endpoint initialization in the [cxf-spring-boot-starter](https://github.com/codecentric/cxf-spring-boot-starter) ([documentation here](https://github.com/codecentric/cxf-spring-boot-starter#complete-automation-of-endpoint-initialization))\n* Plugin is Eclipse m2e compatible (see [stackoverflow:eclipse-m2e-lifecycle] and [https://wiki.eclipse.org/M2E_compatible_maven_plugins](https://wiki.eclipse.org/M2E_compatible_maven_plugins), so no Plugin execution not covered by lifecycle configuration”-Error should accur\n\n### HowTo\n\n* Put your WSDL into some folder under __/src/main/resources/__ OR __/src/test/resources/__ - and add your XSDs, so they could be imported correct (relatively)\n* If you want to tweak your Namespace-Names, put a binding.xml into the same folder, where your WSDL resides\n* Add this plugin to your pom´s build-section:\n\n```\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003ede.codecentric\u003c/groupId\u003e\n            \u003cartifactId\u003ecxf-spring-boot-starter-maven-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e2.3.0.RELEASE\u003c/version\u003e\n            \u003cexecutions\u003e\n                \u003cexecution\u003e\n                    \u003cgoals\u003e\n                        \u003cgoal\u003egenerate\u003c/goal\u003e\n                    \u003c/goals\u003e\n                \u003c/execution\u003e\n            \u003c/executions\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n\n* it will be executed, if you run a standard:\n\n```\nmvn clean generate-sources\n```\n\n(or directly):\n\n```\nmvn cxf-spring-boot-starter:generate\n```\n\n* The generated JAX-B Classfiles will be placed in target/generated-sources/wsdlimport \n\n\n### Moved from \"OLD\" jaxb to \"NEW\" jaxb\n\nAs you might noticed there is a lot going on in the Community effort to move JavaEE to JakartaEE from Oracle to Eclipse Foundation. \n\nOne of the impacts for this project was that the JAX-B GitHub repo [github.com/javaee/jaxb-v2](https://github.com/javaee/jaxb-v2) was archived and a new GitHub repo [github.com/eclipse-ee4j/jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) has been created.\n\nTherefore we also moved to the new dependencies inside our [pom.xml](pom.xml) - instead of using [the \"OLD JAXB\" with the `com.sun.xml.bind` Maven groupId](https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-xjc), we now use the [\"NEW JAXB\" with the `org.glassfish.jaxb` Maven groupId](https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-xjc):\n\n```\n\t\t\u003c!-- Generate package Name of SEI and WebServiceClient for later\n\t\tAutodetection of Endpoints in cxf-spring-boot-starter --\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.glassfish.jaxb\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ejaxb-xjc\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e${jaxb-xjc.version}\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.glassfish.jaxb\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ejaxb-runtime\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e${jaxb.version}\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n```\n\n\n\n### JDK 11 support\n\nAs of JDK11 many deprecated packages aren't distributed with the JDK anymore - including `javax.xml.ws` (JAX-WS) and `javax.xml.bind` (JAX-B) (see [this post](https://blog.viadee.de/jaxb-und-soap-in-java-11)).\n\nTherefore we add the JAX-WS runtime to our pom.xml:\n\n```\n\t\t\u003c!-- JAXWS for Java 11 --\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003ecom.sun.xml.ws\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ejaxws-rt\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e${jaxws-ri.version}\u003c/version\u003e\n\t\t\t\u003ctype\u003epom\u003c/type\u003e\n\t\t\u003c/dependency\u003e\n```\n\nSadly the jaxws-maven-plugin [isn't JDK11 (nor JDK9) compatible](https://github.com/mojohaus/jaxws-maven-plugin/issues/54) atm! \n\n__BUT__: Thanks so much to [mickaelbaron](https://github.com/mojohaus/jaxws-maven-plugin/issues/54#issuecomment-434323813) for stating, that the [mojohaus/jaxws-maven-plugin](https://github.com/mojohaus/jaxws-maven-plugin) is just deprecated and moved silently to [eclipse-ee4j/metro-jax-ws/tree/master/jaxws-ri/extras/jaxws-maven-plugin](https://github.com/eclipse-ee4j/metro-jax-ws/tree/master/jaxws-ri/extras/jaxws-maven-plugin)!!!\n\n```\nplugin(\n                    groupId(\"com.sun.xml.ws\"),\n                    artifactId(\"jaxws-maven-plugin\"),\n                    version(\"2.3.2\"),\n                    dependencies(\n                            dependency(\n                                    \"org.jvnet.jaxb2_commons\",\n                                    \"jaxb2-namespace-prefix\",\n                                    \"1.3\"))\n                    ),\n```\n\nWith this maintained version of [com.sun.xml.ws.jaxws-maven-plugin](https://mvnrepository.com/artifact/com.sun.xml.ws/jaxws-maven-plugin) we are also able to run on all major JDK versions like a charm!\n\n\n##### Build on multiple JDKs locally\n\nOn our local machine in most situations we only have one JDK installation. There are solutions like [jenv](https://www.jenv.be/), but as I really like Docker, we can also run our builds with it:\n\n```\n# OpenJDK 13 (latest version)\ndocker run --rm -v \"$PWD\":/build/our/plugin -w /build/our/plugin maven:3-jdk-13 bash -c \"mvn clean install\"\n\n# OpenJDK 12 (latest version)\ndocker run --rm -v \"$PWD\":/build/our/plugin -w /build/our/plugin maven:3-jdk-12 bash -c \"mvn clean install\"\n\n# OpenJDK 11 (latest version)\ndocker run --rm -v \"$PWD\":/build/our/plugin -w /build/our/plugin maven:3-jdk-11 bash -c \"mvn clean install\"\n\n# OpenJDK 8 (latest version)\ndocker run --rm -v \"$PWD\":/build/our/plugin -w /build/our/plugin maven:3-jdk-8 bash -c \"mvn clean install\"\n``` \n\n### Integration testing the plugin\n\n\u003e When updating development/release version: don't forget to update [generation-test-project/pom.xml](cxf-spring-boot-starter-maven-plugin-integrationtest/src/test/resources/generation-test-project/pom.xml)!\n\nWe want to avoid as many problems as possible, so we should also do integration tests for this plugin. \n\nThe [docs about testing Maven plugins](https://maven.apache.org/plugin-developers/plugin-testing.html) under the headline `Integration/Functional testing` advice us to use the [org.apache.maven.shared.maven-verifier](https://mvnrepository.com/artifact/org.apache.maven.shared/maven-verifier) plugin (__NOT the standard__ [maven-verifier-plugin](https://maven.apache.org/plugins/maven-verifier-plugin/)!!!), mind the groupId):\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.apache.maven.shared\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-verifier\u003c/artifactId\u003e\n    \u003cversion\u003e1.6\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nWith this dependency we're able to use test the plugin from within JUnit powered Testcases like [CxfSpringBootStarterMavenPluginIntegrationTest.class](cxf-spring-boot-starter-maven-plugin-integrationtest/src/test/java/de/codecentric/cxf/CxfSpringBootStarterMavenPluginIntegrationTest.java):\n\n```java\nimport org.apache.maven.it.VerificationException;\nimport org.apache.maven.it.Verifier;\nimport org.apache.maven.it.util.ResourceExtractor;\nimport org.junit.Test;\n\nimport java.io.File;\nimport java.io.IOException;\n\npublic class CxfSpringBootStarterMavenPluginIntegrationTest {\n\n    @Test\n    public void testJaxBandJaxWsClassfilesGenerationInclPluginProperties() throws IOException, VerificationException {\n\n        // Given\n        File generationTestProjectDir = ResourceExtractor.simpleExtractResources( getClass(), \"/generation-test-project\" );\n        Verifier verifier = new Verifier( generationTestProjectDir.getAbsolutePath() );\n\n        // When\n        verifier.executeGoal( \"generate-sources\" );\n\n        // Then\n        verifier.verifyErrorFreeLog();\n    }\n\n}\n```\n\nFor more code examples on how to use the Verifier API, see [this blog post](https://blog.akquinet.de/2011/02/21/testing-maven-plugins-with-the-verifier-approach/). \n\nAs you may notice, we need a example project `generation-test-project` with a working [pom.xml](cxf-spring-boot-starter-maven-plugin-integrationtest/src/test/resources/generation-test-project/pom.xml) inside `src/test/resources/generation-test-project`:\n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n    \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n\n    \u003cgroupId\u003ede.codecentric.soap\u003c/groupId\u003e\n    \u003cartifactId\u003egeneration-test-project\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0-SNAPSHOT\u003c/version\u003e\n    \u003cpackaging\u003ejar\u003c/packaging\u003e\n\n    \u003cdescription\u003eProject solely for integrationtesting the cxf-spring-boot-starter-maven-plugin\u003c/description\u003e\n\n    \u003cproperties\u003e\n        \u003cproject.build.sourceEncoding\u003eUTF-8\u003c/project.build.sourceEncoding\u003e\n        \u003cjava.version\u003e1.8\u003c/java.version\u003e\n    \u003c/properties\u003e\n\n    \u003cbuild\u003e\n        \u003cplugins\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003ede.codecentric\u003c/groupId\u003e\n                \u003cartifactId\u003ecxf-spring-boot-starter-maven-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e2.1.6-SNAPSHOT\u003c/version\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        \u003cgoals\u003e\n                            \u003cgoal\u003egenerate\u003c/goal\u003e\n                        \u003c/goals\u003e\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n            \u003c/plugin\u003e\n        \u003c/plugins\u003e\n    \u003c/build\u003e\n\n\u003c/project\u003e\n```\n\nAnd we need to introduce a parent pom to the project - because before actually running the integration test with `org.apache.maven.shared.maven-verifier` we need to execute the full Maven lifecycle incl. `mvn install` for the standard `cxf-spring-boot-starter-maven-plugin` project. Otherwise we wouldn't have something to integration test - and the second Maven module build would fail!\n\nThe parent [pom.xml](pom.xml) therefore has a `modules` section:\n\n```\n\t\u003cmodules\u003e\n\t\t\u003cmodule\u003ecxf-spring-boot-starter-maven-plugin\u003c/module\u003e\n\t\t\u003cmodule\u003ecxf-spring-boot-starter-maven-plugin-integrationtest\u003c/module\u003e\n\t\u003c/modules\u003e\n```\n\nBecause we want to release this plugin to Maven central, all configuration needed there has also been placed into the parent pom.xml, which makes the plugin's pom.xml much more readable, since it only contains the configuration and dependencies really needed.\n\n##### Handling the ArtifactResolutionException: Could not find artifact de.codecentric:cxf-spring-boot-starter-maven-plugin:jar:2.1.6-SNAPSHOT error\n\nThere is one problem with the [org.apache.maven.shared.maven-verifier plugin](https://mvnrepository.com/artifact/org.apache.maven.shared/maven-verifier. When I first used the plugin, I got this error\n\n```\n[INFO] ------------\u003c de.codecentric.soap:generation-test-project \u003e-------------\n[INFO] Building generation-test-project 1.0.0-SNAPSHOT\n[INFO] --------------------------------[ jar ]---------------------------------\n[WARNING] The POM for de.codecentric:cxf-spring-boot-starter-maven-plugin:jar:2.1.6-SNAPSHOT is missing, no dependency information available\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  1.193 s\n[INFO] Finished at: 2019-06-19T15:19:36+02:00\n[INFO] ------------------------------------------------------------------------\n[ERROR] Plugin de.codecentric:cxf-spring-boot-starter-maven-plugin:2.1.6-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact de.codecentric:cxf-spring-boot-starter-maven-plugin:jar:2.1.6-SNAPSHOT -\u003e [Help 1]\norg.apache.maven.plugin.PluginResolutionException: Plugin de.codecentric:cxf-spring-boot-starter-maven-plugin:2.1.6-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact de.codecentric:cxf-spring-boot-starter-maven-plugin:jar:2.1.6-SNAPSHOT\n    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:128)\n    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:182)\n    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor (DefaultMavenPluginManager.java:286)\n    at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor (DefaultBuildPluginManager.java:244)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleMappingDelegate.calculateLifecycleMappings (DefaultLifecycleMappingDelegate.java:116)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:265)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:217)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:126)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144)\n    at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:97)\n    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111)\n    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)\n    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)\n    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)\n    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)\n    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)\n    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)\n    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)\n    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)\n    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)\n    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)\n    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)\n    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)\n    at java.lang.reflect.Method.invoke (Method.java:567)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)\nCaused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact de.codecentric:cxf-spring-boot-starter-maven-plugin:jar:2.1.6-SNAPSHOT\n    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:423)\n    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:225)\n    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:202)\n    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:257)\n    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:124)\n    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:182)\n    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor (DefaultMavenPluginManager.java:286)\n    at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor (DefaultBuildPluginManager.java:244)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleMappingDelegate.calculateLifecycleMappings (DefaultLifecycleMappingDelegate.java:116)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:265)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:217)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:126)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144)\n    at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:97)\n    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111)\n    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)\n    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)\n    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)\n    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)\n    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)\n    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)\n    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)\n    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)\n    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)\n    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)\n    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)\n    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)\n    at java.lang.reflect.Method.invoke (Method.java:567)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)\nCaused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact de.codecentric:cxf-spring-boot-starter-maven-plugin:jar:2.1.6-SNAPSHOT\n    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:413)\n    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:225)\n    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:202)\n    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:257)\n    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:124)\n    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:182)\n    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor (DefaultMavenPluginManager.java:286)\n    at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor (DefaultBuildPluginManager.java:244)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleMappingDelegate.calculateLifecycleMappings (DefaultLifecycleMappingDelegate.java:116)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:265)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:217)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:126)\n    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144)\n    at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:97)\n    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111)\n    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)\n    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)\n    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)\n    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)\n    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)\n    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)\n    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)\n    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)\n    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)\n    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)\n    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)\n    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)\n    at java.lang.reflect.Method.invoke (Method.java:567)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)\n    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)\n[ERROR]\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.\n[ERROR]\n[ERROR] For more information about the errors and possible solutions, please read the following articles:\n[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException\n\n\tat org.apache.maven.it.Verifier.executeGoals(Verifier.java:1369)\n\tat org.apache.maven.it.Verifier.executeGoal(Verifier.java:1254)\n\tat org.apache.maven.it.Verifier.executeGoal(Verifier.java:1248)\n\tat de.codecentric.cxf.CxfSpringBootStarterMavenPluginIntegrationTest.testJaxBandJaxWsClassfilesGenerationInclPluginProperties(CxfSpringBootStarterMavenPluginIntegrationTest.java:21)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:567)\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:567)\n\tat org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)\n\tat org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)\n\tat org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)\n\n\nResults :\n\nTests in error:\n  testJaxBandJaxWsClassfilesGenerationInclPluginProperties(de.codecentric.cxf.CxfSpringBootStarterMavenPluginIntegrationTest): Exit code was non-zero: 1; command line and log = (..)\n\nTests run: 1, Failures: 0, Errors: 1, Skipped: 0\n\n[INFO] ------------------------------------------------------------------------\n[INFO] Reactor Summary for cxf-spring-boot-starter-maven-plugin-reactor 2.1.6-SNAPSHOT:\n[INFO]\n[INFO] cxf-spring-boot-starter-maven-plugin-reactor ....... SUCCESS [  0.589 s]\n[INFO] cxf-spring-boot-starter-maven-plugin ............... SUCCESS [  4.294 s]\n[INFO] cxf-spring-boot-starter-maven-plugin-integrationtest FAILURE [  2.959 s]\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  8.017 s\n[INFO] Finished at: 2019-06-19T15:19:36+02:00\n[INFO] ------------------------------------------------------------------------\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project cxf-spring-boot-starter-maven-plugin-integrationtest: There are test failures.\n```\n\nAfter some hours of digging into the problem, I finally went to the source code of the [Verifier.java](https://github.com/apache/maven-verifier/blob/master/src/main/java/org/apache/maven/shared/verifier/Verifier.java#L195):\n\n```\n    private void findDefaultMavenHome()\n        throws VerificationException\n    {\n        defaultClasspath = System.getProperty( \"maven.bootclasspath\" );\n        defaultClassworldConf = System.getProperty( \"classworlds.conf\" );\n        defaultMavenHome = System.getProperty( \"maven.home\" );\n\n        if ( defaultMavenHome == null )\n        {\n            Properties envVars = CommandLineUtils.getSystemEnvVars();\n            defaultMavenHome = envVars.getProperty( \"M2_HOME\" );\n        }\n\n        if ( defaultMavenHome == null )\n        {\n            File f = new File( System.getProperty( \"user.home\" ), \"m2\" );\n            if ( new File( f, \"bin/mvn\" ).isFile() )\n            {\n                defaultMavenHome = f.getAbsolutePath();\n            }\n        }\n}\n```\n\nAnd there we are - if we havent set either `M2_HOME` or `maven.home`, the Verifier will place an ugly `${user.home)/m2` directory inside the `cxf-spring-boot-starter-maven-plugin-integrationtest` project folder and tries to download our pre-build `de.codecentric:cxf-spring-boot-starter-maven-plugin:jar:2.1.6-SNAPSHOT`, which isn't available on Maven central - since this was only build into our local Maven repository located under `$HOME/.m2/repository`.\n\nFinally the `README` of the [Maven plugin integration testing source](https://github.com/apache/maven-integration-testing) gave me the hint - we simply use a CLI parameter to set the correct Maven repository location:\n\n```\nmvn clean install -Dmaven.repo.local=$HOME/.m2/repository\n```\n\n__BUT:__ this means, we need to set this `-D` parameter every time we want to run our integration tests, which is quite nasty. Isn't there a way we could set this programmatically, since our tests aren't executable inside our IDEs otherwise. \n\nLooking into the the [Verifier source at line 137](https://github.com/apache/maven-verifier/blob/master/src/main/java/org/apache/maven/shared/verifier/Verifier.java#L137) we find out, that there are other constructors - e.g. one with a `settingsFile` parameter, where we can inject the current systems configuration (which mainly also inherits the maven repo path). So we initialize the `Verifier` with:\n\n```\n        verifier = new Verifier( generationTestProjectDir.getAbsolutePath(), \"$HOME/.m2/settings.xml\");\n```\n\nNow the tests should work also inside our IDEs and without setting the `-D` parameter.\n\n\n##### Where's the log file?\n\nWe configure the `Verifier` to name the log file like this:\n\n```\nverifier.setLogFileName(\"verifier-output.log\");\n```\n\nBut where can I find this file? Have a look into `target/test-classes/yourTestProjectName`. In this plugin's case, the file is located in:\n\n```\ncxf-spring-boot-starter-maven-plugin/cxf-spring-boot-starter-maven-plugin-integrationtest/target/test-classes/generation-test-project/verifier-output.log\n```\n\n##### Final testcase\n\nNow after all this our Testcase [CxfSpringBootStarterMavenPluginIntegrationTest.class](cxf-spring-boot-starter-maven-plugin-integrationtest/src/test/java/de/codecentric/cxf/CxfSpringBootStarterMavenPluginIntegrationTest.java) looks like:\n                       \n```java\npackage de.codecentric.cxf;\n\nimport org.apache.maven.it.VerificationException;\nimport org.apache.maven.it.Verifier;\nimport org.apache.maven.it.util.ResourceExtractor;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport java.io.File;\nimport java.io.IOException;\n\npublic class CxfSpringBootStarterMavenPluginIntegrationTest {\n\n    private File generationTestProjectDir;\n    private Verifier verifier;\n\n    @Before\n    public void setUp() throws IOException, VerificationException {\n        // Given\n        generationTestProjectDir = ResourceExtractor.simpleExtractResources( getClass(), \"/generation-test-project\" );\n        verifier = new Verifier( generationTestProjectDir.getAbsolutePath(), \"$HOME/.m2/settings.xml\");\n        verifier.setLogFileName(\"verifier-output.log\");\n    }\n\n    @Test\n    public void plugin_output_should_look_good_in_log() throws VerificationException {\n\n        // When\n        verifier.executeGoal( \"generate-sources\" );\n\n        // Then\n        verifier.verifyErrorFreeLog();\n        verifier.verifyTextInLog(\"CXF-BOOT-MAVEN-PLUGIN STEP 0: Scanning for WSDL file in src/main/resources\");\n        verifier.verifyTextInLog(\"CXF-BOOT-MAVEN-PLUGIN STEP 1: Found .wsdl-File\");\n        verifier.verifyTextInLog(\"CXF-BOOT-MAVEN-PLUGIN STEP 2: Generating JAX-B Classfiles.\");\n        verifier.verifyTextInLog(\"Processing: file:\");\n        verifier.verifyTextInLog(\"jaxws:wsimport args: [-keep, -s, '\");\n        verifier.verifyTextInLog(\"CXF-BOOT-MAVEN-PLUGIN setting relative wsdlLocation into @WebServiceClient:\");\n        verifier.verifyTextInLog(\"CXF-BOOT-MAVEN-PLUGIN STEP 4: Guessing SEI implementation´s package name \u0026 injecting it into cxf-spring-boot-maven.properties for later Autodetection of Endpoints...\");\n        verifier.verifyTextInLog(\"CXF-BOOT-MAVEN-PLUGIN STEP 5: Extracting targetNamespace from WSDL, generating packageName from it with com.sun.tools.xjc.api.XJC (see wsgen, WSImportTool and WSDLModeler at line 2312 of the JAXWSRI) and injecting it into cxf-spring-boot-maven.properties for later Autodetection of Endpoints...\");\n\n        // Reset the streams before executing the verifier\n        verifier.resetStreams();\n    }\n\n}\n```\n\n\n[cxf-spring-boot-starter]:https://github.com/codecentric/cxf-spring-boot-starter\n[jaxws-maven-plugin]:https://github.com/eclipse-ee4j/metro-jax-ws/tree/master/jaxws-ri/extras/jaxws-maven-plugin\n[mojo-executor]:https://github.com/TimMoore/mojo-executor\n[stackoverflow:eclipse-m2e-lifecycle]:http://stackoverflow.com/a/26447353/4964553\n[bipro.net]:https://www.bipro.net/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecentric%2Fcxf-spring-boot-starter-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecentric%2Fcxf-spring-boot-starter-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecentric%2Fcxf-spring-boot-starter-maven-plugin/lists"}