I'm trying to do contract testing using Pact and working in a corporate where we have a Nexus setup. I suspect that the modified Eclipse installation here uses the Nexus not the Maven repo. I created a sample Maven project, copied the following pom from a similar consumer project and just modified the provider dependency:
<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>ctfaturaprovider</groupId>
<artifactId>contract-testing-fatura-provider</artifactId>
<version>0.0.1-SNAPSHOT</version>
<!-- Kontrat testing ile ilgili parent: -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<relativePath />
</parent>
<build>
<finalName>BSA_ctfaturaprovider_ContractTestingFaturaProvider</finalName>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>update_bsa_versions</id>
<phase>validate</phase>
<goals>
<goal>use-latest-snapshots</goal>
</goals>
<inherited>false</inherited>
<configuration>
<includes>com.akbank.*:*</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>akbank-maven-snapshots</id>
<name>akbank-maven-snapshots</name>
<url>${akbank-maven-snapshots.url}</url>
</snapshotRepository>
<repository>
<id>akbank-maven-releases</id>
<name>akbank-maven-releases</name>
<url>${akbank-maven-releases.url}</url>
</repository>
</distributionManagement>
<dependencies>
<!-- Kontrat testing ile ilgili dependency'ler: -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>au.com.dius.pact.provider</groupId>
<artifactId>junit</artifactId>
<version>4.4.2</version>
<scope>test</scope>
</dependency>
<!-- Kontrat testing ile ilgili dependency'ler sonu -->
<dependency>
<groupId>com.akbank.bsa</groupId>
<artifactId>bsa-core</artifactId>
<version>0.1.2-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.akbank.bsa</groupId>
<artifactId>bsa-unittest</artifactId>
<version>1.0.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
When I save this pom, I get this error for hundreds of dependencies:
Failed to read artifact descriptor for com.google.guava:guava:jar:31.1.0.redhat-00001
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.google.guava:guava:jar:31.1.0.redhat-00001
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:329)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:215)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:188)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:119)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:636)
at org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:530)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:492)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:496)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:351)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:298)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:154)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:89)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Failure to find com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in https://nexus.akbankpreprod.com/repository/maven-public-int/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-public-int has elapsed or updates are forced
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:177)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:226)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1000)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:800)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:329)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
... 53 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in https://nexus.akbankpreprod.com/repository/maven-public-int/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-public-int has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:173)
... 58 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in https://nexus.akbankpreprod.com/repository/maven-public-int/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-public-int has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
... 61 more
I tried to Maven\Update Project with Force Update option with no luck. When I search the reported dependency, I can see it in our Nexus:
Another similar pom causes no problem in the same eclipse workspace:
<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>CaginGroupID</groupId>
<artifactId>SpringBootFaturaConsumer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<relativePath />
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>au.com.dius.pact.consumer</groupId>
<artifactId>junit</artifactId>
<version>4.1.40</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
My colleague from Nexus team has reported that a similar issue in guava-retrying is closed by using a different version. But I'm not direcly using the guava-retrying, it is the pact provider library (reported by a dependency analyzer used in our organization):
[ERROR] Failed to execute goal on project contract-testing-fatura-provider: Could not resolve dependencies for project ctfaturaprovider:contract-testing-fatura-provider:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at au.com.dius.pact.provider:junit:jar:4.4.2 -> com.github.rholder:guava-retrying:jar:2.0.0 -> com.google.guava:guava:jar:31.1.0.redhat-00001: Failed to read artifact descriptor for com.google.guava:guava:jar:31.1.0.redhat-00001: Could not find artifact com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in maven-public (https://nexus.akbankpreprod.com/repository/maven-public/)
I'm new to this maven and nexus and all the other fancy stuff. Where should I look at?
The solution is here: https://stackoverflow.com/a/74897084/1728856. Is is basically JBoss setup asking for a 10.+ version of Guava and Maven picking a broken one.
Related
In order to add azure app insights in an old spring-boot jar(which already has micrometer), I've created a new spring-boot project and added it as a dependency. However, after a successful Maven build, while executing it as spring-boot app, I'm getting Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.class] exception. Here are my two POM files,
POM of the old spring-boot jar:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>microservice</artifactId>
<groupId>my-app-service</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>microservice-my-app</artifactId>
<dependencies>
<!-- few dependencies -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifestEntries>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>app</classifier>
<mainClass>com.my.package.MyApplication</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
POM of the new spring-boot project:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.my.app.appinsights</groupId>
<artifactId>microservice-my-app-appinsights</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>microservice-my-app-appinsights</name>
<description>Demo project for Spring Boot</description>
<properties>
<applicationinsights.version>1.1.1</applicationinsights.version>
<java.version>1.8</java.version>
<applicationinsights.version>2.5.1</applicationinsights.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>my-app-service</groupId>
<artifactId>microservice-my-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-spring-boot-starter</artifactId>
<version>${applicationinsights.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-webflux</artifactId>
<version>3.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifestEntries>
<Implementation-Version>1.0.0</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>app</classifier>
<mainClass>com.my.app.appinsights.MicroserviceMyAppinsightsApplication</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Exception stack:
2020-02-03 13:48:39.726 WARN 2420 --- [ main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.microsoft.applicationinsights.autoconfigure.ApplicationInsightsWebMvcAutoConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.class] cannot be opened because it does not exist
2020-02-03 13:48:39.734 INFO 2420 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-02-03 13:48:39.742 ERROR 2420 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.microsoft.applicationinsights.autoconfigure.ApplicationInsightsWebMvcAutoConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:596)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:302)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:586)
at org.springframework.context.annotation.ConfigurationClassParser.access$900(ConfigurationClassParser.java:108)
at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:805)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:801)
at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:771)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)
at com.my.app.appinsights.MicroserviceMyAppinsightsApplication.main(MicroserviceMyAppinsightsApplication.java:14)
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:51)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)
at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86)
at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81)
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:682)
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getSuperClass(ConfigurationClassParser.java:995)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:332)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:586)
... 22 common frames omitted
It turns out that the azure app-insights needs spring-boot-starter-web to work properly. But since that jar is already present in the parent of the existing jar, I can not add it to my current POM file. This might mean I might not be importing the old jar in my new POM correctly.
How do I add the existing spring-boot jar as a dependency in my new spring-boot's POM file, without making any modifications in the existing jar or its POM?
Can you please check the packing of both the projects, if the child project has different packing then parent project, then you need to add component scan at your child main class from where you are running your project.
For example,
Parent project has package name
com.my.app
And
child project had package name
com.my.app.appinsights
then you need to add component scan in main class
#ComponentScan("com.my.app")
Spring boot by default scan beans from sub-packages of the main class. To override the component scan you need to add this annotation so that it will scan beans from given package also.
I have been trying to build a code using Springtools. But I am stuck with an error.
My system configurations as shown by maven is followning:
>Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T15:49:05-04:00)
>Maven home: C:\Users\Felipe\Documents\Proyecto\backend\module-ebs\EMBEDDED
Java version: 1.8.0_201, vendor: Oracle Corporation
>Java home: C:\Program Files\Java\jre1.8.0_201
>Default locale: en_US, platform encoding: Cp1252
>OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Following is the Maven trace for the error:
[ERROR] Failed to execute goal on project module-ebs: Could not resolve >dependencies for project com.mexperience:module-ebs:jar:0.0.1-SNAPSHOT: Could >not find artifact com.mexperience:module-core:jar:0.0.1-SNAPSHOT -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute >goal on project module-ebs: Could not resolve dependencies for project >com.mexperience:module-ebs:jar:0.0.1-SNAPSHOT: Could not find artifact >com.mexperience:module-core:jar:0.0.1-SNAPSHOT
at >org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:269)
at >org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:147)
at >org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:246)
at >org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:200)
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:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.mexperience:module-ebs:jar:0.0.1-SNAPSHOT: Could not find artifact com.mexperience:module-core:jar:0.0.1-SNAPSHOT
at >org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:208)
at >org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:243)
... 23 more
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact com.mexperience:module-core:jar:0.0.1-SNAPSHOT
at >org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:355)
at >org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:202)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.mexperience:module-core:jar:0.0.1-SNAPSHOT
at >org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
at >org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
at >org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:338)
... 25 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.mexperience:module-core:jar:0.0.1-SNAPSHOT
at >org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:412)
... 27 more
[ERROR]
[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
and this is the pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
pom
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.mexperience</groupId>
<artifactId>backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>backend</name>
<modules>
<module>module-core</module>
<module>module-ebs</module>
<module>module-resource</module>
</modules>
<properties>
<java.version>1.8</java.version>
<maven.test.skip>true</maven.test.skip>
<docker.registry>docker.mexperiencia.io</docker.registry>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.mexperience</groupId>
<artifactId>module-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.mexperience</groupId>
<artifactId>module-ebs</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.mexperience</groupId>
<artifactId>module-resource</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--Docker-->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.27.2</version>
<extensions>true</extensions>
<configuration>
<images>
<image>
<name>${docker.registry}/${project.groupId}.${project.artifactId}</name>
<build>
<from>openjdk:8-alpine</from>
<tags>
<tag>latest</tag>
</tags>
<env>
</env>
<entryPoint>
<exec>
<arg>java</arg>
<arg>-jar</arg>
<arg>-Xmx768m</arg>
<arg>-Xms768m</arg>
<arg>/root/${project.build.finalName}.jar</arg>
</exec>
</entryPoint>
<assembly>
<targetDir>/root</targetDir>
<mode>dir</mode>
<descriptorRef>artifact</descriptorRef>
</assembly>
<ports>
<port>8080</port>
</ports>
</build>
<run>
<!--<memory>1073741824</memory>-->
<!--<volumes>-->
<!--<bind>-->
<!--<volume></volume>-->
<!--</bind>-->
<!--</volumes>-->
</run>
</image>
</images>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- <repositories>-->
<!-- <repository>-->
<!-- <id>project-repository</id>-->
<!-- <url>file://${project.basedir}/.project-repository</url>-->
<!-- </repository>-->
<!-- </repositories>-->
I follow the instructions indicated in this article:
https://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
But it didn´t work. I also executed mvn clean install but doesn´t work either.
What I can do=?
I'm developing an editor plug-in in Eclipse Neon. The project is separated into a parent project, managing it's dependencies and a child project, which contains the actual source code. After migrating my plug-in from Eclipse Mars to Neon, I changed the method IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true); to IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true);, because the first one is deprecated now. If I try to rebuild the project with Maven, it gives me a compilation failure:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project language-editor-core: Compilation failure: Compilation failure:
[ERROR] C:\Users\X\Documents\tfeditor\language-editor-core\src\main\java\de\se_rwth\langeditor\texteditor\hyperlinks\HyperlinkDetectorImpl.java:[228]
[ERROR] IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true);
[ERROR] ^^^^^^^^^^^^^^^^^^^
[ERROR] The method getEditorDescriptor(String, boolean) in the type IDE is not applicable for the arguments (String, boolean, boolean)
[ERROR] 1 problem (1 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]
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :language-editor-core
The pom.xml of the parent project is this one:
<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>de.monticore</groupId>
<artifactId>language-editor</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Language Editor</name>
<organization>
<name>Department of Software Engineering, RWTH Aachen University</name>
<url>http://www.se-rwth.de/</url>
</organization>
<packaging>pom</packaging>
<modules>
<module>language-editor-core</module>
<module>cdtrans-editor</module>
<module>matrans-editor</module>
<module>language-editor-updatesite</module>
</modules>
<properties>
<monticore.version>4.5.0</monticore.version>
<monticoreRuntime.version>4.5.0</monticoreRuntime.version>
<cd4a.version>1.3.7-SNAPSHOT</cd4a.version>
<cd4a-trans.version>0.0.3-SNAPSHOT</cd4a-trans.version>
<typestrans.version>0.0.3-SNAPSHOT</typestrans.version>
<literalstrans.version>0.0.3-SNAPSHOT</literalstrans.version>
<tfruntime.version>4.4.0-SNAPSHOT</tfruntime.version>
<odrules.version>4.4.0-SNAPSHOT</odrules.version>
<secommons.version>1.7.7</secommons.version>
<antlr.version>4.5</antlr.version>
<guava.version>18.0</guava.version>
<matrans.version>0.0.2.E-SNAPSHOT</matrans.version>
<macommontrans.version>0.0.2-SNAPSHOT</macommontrans.version>
<tycho.version>0.22.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<wagon.version>1.0</wagon.version>
<compiler.plugin>3.3</compiler.plugin>
<java.version>1.8</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-utilities</artifactId>
<version>${secommons.version}</version>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticoreRuntime.version}</version>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>cd4analysis</artifactId>
<version>${cd4a.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>cd4a-trans</artifactId>
<version>${cd4a-trans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>literalstrans</artifactId>
<version>${literalstrans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>typestrans</artifactId>
<version>${typestrans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>de.monticore.tf.runtime</artifactId>
<version>${tfruntime.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>de.monticore.tf.odrules</artifactId>
<version>${tfruntime.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>${antlr.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>${antlr.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>matrans</artifactId>
<version>${matrans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>macommontrans</artifactId>
<version>${macommontrans.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>de.se_rwth.eclipse</groupId>
<artifactId>de.se_rwth.eclipse.targetplatform.luna</artifactId>
<version>1.0.2-SNAPSHOT</version>
</artifact>
</target>
<pomDependencies>consider</pomDependencies>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>${wagon.version}</version>
<executions>
<execution>
<id>deploy-repository</id>
<phase>deploy</phase>
<goals>
<goal>upload-single</goal>
</goals>
<configuration>
<fromFile>${project.build.directory}/${project.build.finalName}.zip</fromFile>
<serverId>se-nexus</serverId>
<url>https://nexus.se.rwth-aachen.de/service/local/repositories/monticore-snapshots/content-compressed</url>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<repository>
<id>se-nexus</id>
<url>http://nexus.se.rwth-aachen.de/content/repositories/monticore-releases/</url>
</repository>
<snapshotRepository>
<id>se-nexus</id>
<url>http://nexus.se.rwth-aachen.de/content/repositories/monticore-snapshots/</url>
</snapshotRepository>
<site>
<id>se-nexus</id>
<url>dav:http://nexus.se.rwth-aachen.de/content/sites/se-sites/monticore/${project.version}/</url>
</site>
</distributionManagement>
<repositories>
<repository>
<id>se-public</id>
<url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>se-public</id>
<url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
</project>
The specific line in the code is not marked as wrong by Eclipse and the execution of the code also works well, so where is the problem?
Indeed, after adding the Eclipse Neon repository to the pom.xml with this:
<repositories>
<repository>
<id>eclipse-neon</id>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
</repositories>
, the Maven build works and does not mark the editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true); as an error -> Problem solved
do a
mvn clean
and try to build once more
I try to follow : Hosting a Maven repository on github
My POM.xml
<parent>
<artifactId>rf</artifactId>
<groupId>com.zlhades</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>rfcore</artifactId>
<properties>
<java-version>1.7</java-version>
<github.global.server>github</github.global.server>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Maven artifacts for ${project.version}</message> <!-- git commit message -->
<noJekyll>true</noJekyll> <!-- disable webpage processing -->
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above -->
<branch>refs/heads/mvn-repo</branch> <!-- remote branch name -->
<includes><include>**/*</include></includes>
<repositoryName>RequestForward</repositoryName> <!-- github repo name -->
<repositoryOwner>zlhades</repositoryOwner> <!-- github username -->
</configuration>
<executions>
<!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
<scope>test</scope>
</dependency>
</dependencies>
And I got below error:
=========================log==========================
[ERROR] Failed to execute goal
com.github.github:site-maven-plugin:0.12:site (default) on project
rfcore: Error creating commit: Invalid request.
[ERROR] For 'properties/name', nil is not a string.
[ERROR] For 'properties/name', nil is not a string. (422)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal com.github.github:site-maven-plugin:0.12:site (default)
on project rfcore: Error creating commit: Invalid request.
For 'properties/name', nil is not a string.
For 'properties/name', nil is not a string. (422)
=========================log==========================
How to fix this issue?
Thx, I found the answer:
The comment at the bottom of this post suggests that you need to have filled in the Real Name field in your github profile to avoid this error.
https://malalanayake.wordpress.com/2014/03/10/create-simple-maven-repository-on-github/
I am upgrading my system's Maven runtime from 3.0.5 to 3.1.1 and trying to build my project using mvn clean install like I normally would. Using the older Maven runtime, the build would always succeed. However, I am now always getting this error message during the build:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default-descriptor) on project XYZ: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor failed: 48188 -> [Help 1]
I thought that perhaps it was due to my dependencies and plugins being outdated, so I ran mvn versions:use-latest-versions to update my pom.xml versions. That still did not fix this issue. Any ideas?
UPDATE
By popular demand, here is what my pom.xml file looks like. Note that all dependency and plugin versions were updated by mvn versions:use-latest-versions except for Sitebricks and qdox, due to breaking changes that I didn't want to integrate into my project.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.my.company</groupId>
<artifactId>my-own-project</artifactId>
<version>1.0.1-SNAPSHOT</version>
<name>My Cool Maven Plugin</name>
<packaging>maven-plugin</packaging>
<distributionManagement>
<repository>
<id>someID</id>
<url>http://some.url.com</url>
</repository>
</distributionManagement>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.20</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.11</version>
</dependency>
<dependency>
<groupId>com.google.sitebricks</groupId>
<artifactId>sitebricks</artifactId>
<version>0.8.5</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<effort>Max</effort>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</reporting>
</project>
Upgrading and using below dependency with config resolved my issue:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
I had exactly the same problem and tried probably every hint provided in the possible duplicate Basic maven plugin project not working, Mojo plugin descriptors not generating, but nothing worked. Eventually in turned out that an old version 2.6.1 of the library com.ibm.icu:icu4j that was used by some other 3rd party module was responsible. I got rid of the icu4j dependency entirely and maven-plugin-plugin run with out problems thereafter.