When I run maven install -o -X, maven puts the output (a jar) to the .m2 folder. The problem is that in my case this generates a metadata file named "maven-metadata-local.xml". When I reference this artifact from another maven build, maven complains that the metadata file "maven-metadata.xml" cannot be found (at the exact same location).
So basically I have to questions:
Where does the "-local" part come from and what does it exactly mean?
How to I make this build work, i.e. tell maven to name the meta-data file "maven-metadata.xml" while building the first artifact or tell maven to look for the file "maven-metadata-local.xml" when resolving the dependencies in the second build?
The dependency in the second pom is:
<dependencies>
<dependency>
<groupId>a.b.c</groupId>
<artifactId>d</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
the location of the jar in the local .m2 directory is
.m2/a/b/c/d/1.0.0-SNAPSHOT/d-1.0.0-SNAPSHOT.jar
Here is the error message:
[DEBUG] =======================================================================
[DEBUG] Cannot access central (https://repo1.maven.org/maven2) in offline mode and the metadata ch.*****.*****:*****-server:1.0.0-SNAPSHOT/maven-metadata.xml has not been downloaded from it before
[DEBUG] Cannot access central (https://repo1.maven.org/maven2) in offline mode and the metadata ch.*****.*****:*****-server:1.0.0-SNAPSHOT/maven-metadata.xml has not been downloaded from it before
[DEBUG] Could not find metadata ch.*****.*****:*****-project:1.0.0-SNAPSHOT/maven-metadata.xml in local (/home/*****/.m2/repository)
[DEBUG] Cannot access central (https://repo1.maven.org/maven2) in offline mode and the metadata ch.*****.*****:*****-project:1.0.0-SNAPSHOT/maven-metadata.xml has not been downloaded from it before
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=0, ConflictMarker.nodeCount=2, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=17, DefaultDependencyCollector.transformTime=7}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.268 s
[INFO] Finished at: 2016-11-29T15:25:03+01:00
[INFO] Final Memory: 16M/481M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project *****-assembly: Could not resolve dependencies for project ch.*****.*****:*****-assembly:pom:1.0.0-SNAPSHOT: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT: Failed to read artifact descriptor for ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project *****-assembly: Could not resolve dependencies for project ch.*****.*****:*****-assembly:pom:1.0.0-SNAPSHOT: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project ch.*****.*****:*****-assembly:pom:1.0.0-SNAPSHOT: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:180)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:291)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
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.collectDependencies(DefaultDependencyCollector.java:254)
... 26 more
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before.
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)
... 33 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before.
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)
... 38 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before.
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:391)
... 41 more
Caused by: org.eclipse.aether.transfer.RepositoryOfflineException: Cannot access central (https://repo1.maven.org/maven2) in offline mode
at org.eclipse.aether.internal.impl.DefaultOfflineController.checkOffline(DefaultOfflineController.java:72)
at org.eclipse.aether.internal.impl.Utils.checkOffline(Utils.java:115)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:387)
... 41 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
Related
I am building my apps with Maven-3 and i guess after auto-refresh of maven-surefire-plugin to 3.0.0-M1 i am not able to do build and getting the below error.
As a initial step, I have cleared the directory /org/apache/maven in my repository however still i am facing the issue. Can anyone advise. Note - if i am downgrading the surefire plugin to 2.x then I am able to build it.
Error log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.444s
[INFO] Finished at: Thu Nov 08 16:04:53 GMT 2018
[INFO] Final Memory: 60M/704M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project TEST_PROJECT: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
[ERROR] while locating org.apache.maven.plugin.surefire.SurefirePlugin
[ERROR] at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project TEST_PROJECT: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1'
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1'
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:488)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
... 20 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Guice provision errors:
1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
while locating org.apache.maven.plugin.surefire.SurefirePlugin
at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test)
1 error
role: org.apache.maven.plugin.Mojo
roleHint: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:257)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
... 21 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:
1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
while locating org.apache.maven.plugin.surefire.SurefirePlugin
at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test)
1 error
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
... 23 more
You can upgrade your maven version to 3.6.0 latest to solve this issue. This can be compatible from 3.3.9 maven version.
Looking at the comments on upgrading maven version, we updated our maven version and was able to overcome the surefire plugin issue using maven 3.3.9. Didn't get any issues.
I found that my NetBeans was using a very old maven (3.0.5) even though I had a brand new maven installed.
On my Mac, I had to go to the menu "Netbeans/Preferences", select the "Maven" tab, and change from "Bundled", browsed to latest, and this got rid of the error above for me.
I had this problem until I discovered that we were not explicitly specifying the version of the surefire plugin. Once I changed our pom.xml file to set the version, it worked.
You can downgrade the version of maven-surefire-plugin to 2.12.4 using the pluginManagement tag. It worked for me.
If you are facing the issue in netbeans IDE you need to change default mavenhome version.follow the below steps
in menu bar tools->Options->click java tab --> under categories --> Execution --> Maven home drop down select manually installed location of the maven
I agree with SomMS's answer
But as an FYI, I found this thread, immediately dismissed that maven version could be the problem the as I just (last week) built this RHEL VM and it was new and shiny
... 15 minutes later I decided to check the maven version to find it was v3.0.5!
Hopefully the next guy doesn't make the same mistake
And if you are wondering how to get the version of whats installed try
mvn --version
I used #SomMS's suggestion and upgraded Maven in order to fix the issue. It worked.
The problem is that, at the time of this writing, the latest version of Maven available on CentOS 7 is 3.0.5 (default repository), which is really old (Feburary 2013). Most other distros have way newer Maven versions available to them.
My only solution was to do a manual download and add path to its binary in PATH env-variable. Downside here is that now rpm/yum are not aware of its existence.
My Jenkins release job, which uses jgitflow-maven-plugin to release an Open Source project on GitHub, throws an exception though it used to work.
Maven goals:
jgitflow:release-start -e -X -Dhttps.protocols=TLSv1.2
jgitflow:release-finish -e -X -Dgpg.useagent=false -Dhttps.protocols=TLSv1.2
Exception:
[DEBUG] (develop) committing all poms on branch 'develop'
[DEBUG] (develop) adding file pattern for poms commit: pom.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.763 s
[INFO] Finished at: 2018-02-11T12:31:56+01:00
[INFO] Final Memory: 28M/492M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish (default-cli) on project my-project: Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish (default-cli) on project my-project: Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.NullPointerException
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.failedResult(AbstractGitFlowCommand.java:133)
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.doPushIfNeeded(AbstractGitFlowCommand.java:104)
at com.atlassian.jgitflow.core.command.ReleaseFinishCommand.call(ReleaseFinishCommand.java:148)
at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowReleaseManager.finish(DefaultFlowReleaseManager.java:99)
at com.atlassian.maven.plugins.jgitflow.mojo.ReleaseFinishMojo.execute(ReleaseFinishMojo.java:174)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
What worked:
a release branch has been created in the remote GitHub project
the artifact with the released version number has been pushed to https://oss.sonatype.org/
the local develop branch has been updated with the next development version
But no commit has been pushed to GitHub. The remote release branch does not have any new commits either.
Caused by: java.lang.NullPointerException
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.failedResult(AbstractGitFlowCommand.java:133)
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.doPushIfNeeded(AbstractGitFlowCommand.java:104)
This looks to me as something went wrong when the plugin wanted to push the commits, but the error message got lost because of a NullPointerException in failedResult!?
Does anyone know what change on the GitHub infrastructure might cause this issue?
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /opt/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-112-generic", arch: "amd64", family: "unix"
The snapshot version 1.0.0-SNAPSHOT of the plugin provided a better error message:
Caused by: com.atlassian.jgitflow.core.exception.JGitFlowGitAPIException: error pushing to develop - status: REJECTED_OTHER_REASON - error: GH006: Protected branch update failed for refs/heads/develop.
error: At least one approved review is required by reviewers with write access.
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.doPushIfNeeded(AbstractGitFlowCommand.java:107)
I had to remove the "Include administrators" flag on the branch protection configuration in GitHub.
I filed an issue to make this version available: https://ecosystem.atlassian.net/browse/MJF-298
I am working at a company where the local machines are working behind a proxy. The proxy requires no authentication. I have a maven project in IntelliJ which works on my laptop but which I cannot get working on the local machine.
So I have imported the project on my local machine.
Set the proxy settings in IntelliJ
Set the proxy settings in my maven settings.xml as shown in this stackoverflow queston
I have also tried the solution presented in this question
where I add -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128 with my proxy settings.
I keep on getting the following errors. In IntelliJ my pom file says:
I have also tried mvn -U clean install as suggested here But then I get the following errorstack:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testforce 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.845 s
[INFO] Finished at: 2018-01-23T11:32:41+01:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo1.maven.org/maven2): Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ). -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:181)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:286)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:169)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:155)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:131)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:110)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
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: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:283)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:199)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:296)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo1.maven.org/maven2): Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:255)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:232)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:268)
... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo1.maven.org/maven2): Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:364)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:76)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:590)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:258)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:529)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:430)
... 32 more
Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1011)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:962)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:126)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:569)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:436)
at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:413)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:456)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:359)
... 37 more
[ERROR]
[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/PluginResolutionException
So according to the error it has failed to authenticate on the proxy, but the proxy needs no authentication. Any idea's how to tackle this issue?
Be sure to declare proxy in maven folder/conf/settings.xml:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<username>user</username>
<password></password>
<host>proxyhost</host>
<port>443</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
Be sure to link the correct settings.xml in Intellij Project clicking on File\Settings\Maven\User Settings File.
Also your exact error is
org.apache.maven.plugin.PluginResolutionException
It seems you need to declare the dependency's pluginrepo in the pom.xml OR the dependency isn't managed anymore from the oldest repo.
Infact the dependency 2.5 is super old, try:
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</dependency>
EDIT:
probably due to Proxy settings (Kerberos NTLM proxy maybe) try this in settings.xml:
<username>DOMAINNAME\USERNAME</username>
Try this, hope it will work.
Eclipse -> window -> preferences -> search for proxy -> Network connection
** check the proxy (password should be correct)
Go to C:\Users\****\.m2\settings.xml - check the setting.xml file - verfiy these lines ->
<id>http-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>***host***</host>
<port>8080</port>
<username>***username***</username>
<password>***password***</password>
<nonProxyHosts>****</nonProxyHosts>
</proxy>
I have this error when attempting to install the maven project:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-only
(analyze-only) on project functional-tests: Dependency
problems found -> [Help 1]
It appears right after the integration tests, during the verify phase. I can hardly guess where to look as not much other information is provided by the logs. I tried to run maven with -X argument to have a deeper look but that's the only error that appears. The last thing I see before the error appears in the detailed log is this WARNING below (that I doubt has anything to do with the error):
[WARNING] Used undeclared dependencies found:
[WARNING] javax.activation:activation:jar:1.1:test
[WARNING] Unused declared dependencies found:
[WARNING] org.slf4j:slf4j-log4j12:jar:1.7.6:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.090 s
[INFO] Finished at: 2017-06-28T10:58:54+08:00
[INFO] Final Memory: 60M/1042M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-only (analyze-only) on project functional-tests: Dependency problems found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-only (analyze-only) on project functional-tests: Dependency problems found
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-only (analyze-only) on project functional-tests: Dependency problems found
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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:497)
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.plugin.MojoExecutionException: Dependency problems found
at org.apache.maven.plugin.dependency.analyze.AbstractAnalyzeMojo.execute(AbstractAnalyzeMojo.java:260)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 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/MojoExecutionException
What could be causing this issue?
UPDATE:
I have resolved the issues that caused the warnings above and it did help removing the error. Now I only wonder why having used undeclared dependencies or declared unused dependencies are causing the whole build to fail?
UPDATE2:
Changing the slf4j scope to runtime also solved the problem.
Apparently the used undeclared dependencies warning was the culprit of my problem. After adding the dependency explicitly to the pom file, the issue was resolved.
The reason of this is:
[WARNING] Used undeclared dependencies found:
[WARNING] javax.activation:activation:jar:1.1:test
[WARNING] Unused declared dependencies found:
[WARNING] org.slf4j:slf4j-log4j12:jar:1.7.6:compile
you should remove org.slf4j:slf4j-log4j12 dependency and add javax.activation:activation dependency.
Same here, got same problem (few times for last few months) and found that fixing all warnings with Used undeclared dependencies/Unused declared dependencies fixes the issue.
I am trying to use Hibernate and SQL Server 2008. I have come across installation of sqljdbc4 into my local Maven Repository. It gives me an error and I have not been able to move forward.
I'm not sure how my local repository should look like (newbie), but the mvn command is giving the error:
[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:m
aven-install-plugin:jar:2.4: Failure to transfer org.apache.maven.plugins:maven-install-plugin:pom:2.4 from https://repo.maven.apache.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:mav
en-install-plugin:pom:2.4 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpa
th.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifac
t descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:122)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:150)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:269)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:239)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:233)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:85)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:302)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:287)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:108)
... 20 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-install-plugin:pom:2.4 from https://repo.maven.apache.org/m
aven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not trans
fer artifact org.apache.maven.plugins:maven-install-plugin:pom:2.4 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path buil
ding failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
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.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:287)
... 23 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.apache.maven.plugins:maven-install-plugin:pom:2.4 from https://repo.maven.apache.org/maven
2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer
artifact org.apache.maven.plugins:maven-install-plugin:pom:2.4 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building
failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:238)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:183)
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)
... 26 more
[ERROR]
[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/PluginResolutionException
Have you triend install command like this?
mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
Typical maven output on the command
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) # standalone-pom ---
[INFO] Installing c:\Data\****\****\temp\sqljdbc4.jar to C:\Users\****\.m2\repository\com\microsoft\sqlserver\sqljdbc4\4.0\sqljdbc4-4.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.458 s
[INFO] Finished at: 2015-06-01T15:40:03+02:00
[INFO] Final Memory: 7M/241M
[INFO] ------------------------------------------------------------------------
Maven dependency should look like this:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
Another alternative to installing sqljdbc4 to local maven repository is to reference it from local filesystem, but there are limitations - path is relative to particular maven module. In one of projects, i put sqljdbc in references directory that is at the same level as maven modules directory and added it as follows:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../references/sqljdbc4.jar</systemPath>
</dependency>
I found the answer a while back but just thought it is fair to post it here.
<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:jtds:sqlserver://server/db</property>
<property name="hibernate.connection.username">here</property>
<property name="hibernate.connection.password">here</property>
<property name="hibernate.connection.pool_size">100</property>
<property name="show_sql">false</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>