2016-11-09 8 views
0

Я пытаюсь создать проект, содержащий банку LDAP (в частности, com.sun.jndi.ldap.LdapCtxFactory).Maven - Не найти файл jar LDAP

Теперь Mavencentral предоставляет возможность com.sun.jndi:ldap:1.2.4, показывая следующий код для зависимости:

<!-- https://mvnrepository.com/artifact/com.sun.jndi/ldap --> 
<dependency> 
    <groupId>com.sun.jndi</groupId> 
    <artifactId>ldap</artifactId> 
    <version>1.2.4</version> 
</dependency> 

Теперь я добавил этот точный фрагмент моей pom.xml (который содержит больше зависимости от mvnrepository, которые работают)

Мои <repositories>

<repositories> 
     <repository> 
      <id>spring-releases</id> 
      <url>https://repo.spring.io/libs-release</url> 
     </repository> 
     <repository> 
      <id>mvnrepository</id> 
      <url>http://mvnrepository.com/artifact/</url> 
     </repository> 
    </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>spring-releases</id> 
      <url>https://repo.spring.io/libs-release</url> 
     </pluginRepository> 
    </pluginRepositories> 

на зависания тег зависимостей он показывает: «не могу фи й артефакт ...

При запуске mvn clean install -X он показывает мне журналы ошибок для поиска .jar файл в repo.spring.io вместо mvncentral, где я ожидал.

Журнал ошибок:

[DEBUG] ======================================================================= 
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=111, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=60, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=16, ConflictResolver.conflictItemCount=100, DefaultDependencyCollector.collectTime=353, DefaultDependencyCollector.transformTime=16} 
[DEBUG] org.springframework:gs-rest-service:war:0.1.0 
[DEBUG] org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile 
[DEBUG]  org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile 
[DEBUG]   org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile 
[DEBUG]   org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile 
[DEBUG]   org.springframework.boot:spring-boot-starter-logging:jar:1.4.0.RELEASE:compile 
[DEBUG]    ch.qos.logback:logback-classic:jar:1.1.7:compile 
[DEBUG]    ch.qos.logback:logback-core:jar:1.1.7:compile 
[DEBUG]    org.slf4j:jcl-over-slf4j:jar:1.7.21:compile 
[DEBUG]    org.slf4j:jul-to-slf4j:jar:1.7.21:compile 
[DEBUG]    org.slf4j:log4j-over-slf4j:jar:1.7.21:compile 
[DEBUG]   org.yaml:snakeyaml:jar:1.17:runtime 
[DEBUG]  org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.0.RELEASE:compile 
[DEBUG]   org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile 
[DEBUG]   org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.4:compile 
[DEBUG]   org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.4:compile 
[DEBUG]  org.hibernate:hibernate-validator:jar:5.2.4.Final:compile 
[DEBUG]   javax.validation:validation-api:jar:1.1.0.Final:compile 
[DEBUG]   org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile (version managed from 3.2.1.Final by org.springframework.boot:spring-boot-dependencies:1.4.0.RELEASE) 
[DEBUG]   com.fasterxml:classmate:jar:1.3.1:compile (version managed from 1.1.0 by org.springframework.boot:spring-boot-dependencies:1.4.0.RELEASE) 
[DEBUG]  com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile 
[DEBUG]   com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile (version managed from 2.8.0 by org.springframework.boot:spring-boot-dependencies:1.4.0.RELEASE) 
[DEBUG]   com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile 
[DEBUG]  org.springframework:spring-web:jar:4.3.2.RELEASE:compile 
[DEBUG]   org.springframework:spring-aop:jar:4.3.2.RELEASE:compile 
[DEBUG]   org.springframework:spring-context:jar:4.3.2.RELEASE:compile 
[DEBUG]  org.springframework:spring-webmvc:jar:4.3.2.RELEASE:compile 
[DEBUG]   org.springframework:spring-expression:jar:4.3.2.RELEASE:compile 
[DEBUG] org.springframework.boot:spring-boot-starter-test:jar:1.4.0.RELEASE:test 
[DEBUG]  org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test 
[DEBUG]  org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.RELEASE:test 
[DEBUG]  com.jayway.jsonpath:json-path:jar:2.2.0:test 
[DEBUG]   net.minidev:json-smart:jar:2.2.1:test 
[DEBUG]    net.minidev:accessors-smart:jar:1.1:test 
[DEBUG]    org.ow2.asm:asm:jar:5.0.3:test 
[DEBUG]  org.assertj:assertj-core:jar:2.5.0:test 
[DEBUG]  org.mockito:mockito-core:jar:1.10.19:test 
[DEBUG]   org.objenesis:objenesis:jar:2.1:test 
[DEBUG]  org.hamcrest:hamcrest-core:jar:1.3:compile 
[DEBUG]  org.hamcrest:hamcrest-library:jar:1.3:test 
[DEBUG]  org.skyscreamer:jsonassert:jar:1.3.0:test 
[DEBUG]   org.json:json:jar:20140107:test (version managed from 20090211 by org.springframework.boot:spring-boot-dependencies:1.4.0.RELEASE) 
[DEBUG]  org.springframework:spring-core:jar:4.3.2.RELEASE:compile 
[DEBUG] org.springframework:spring-jdbc:jar:4.3.2.RELEASE:compile 
[DEBUG]  org.springframework:spring-beans:jar:4.3.2.RELEASE:compile 
[DEBUG]  org.springframework:spring-tx:jar:4.3.2.RELEASE:compile 
[DEBUG] org.springframework:spring-test:jar:4.3.2.RELEASE:compile 
[DEBUG] org.jetbrains.kotlin:kotlin-stdlib:jar:1.0.3:compile 
[DEBUG]  org.jetbrains.kotlin:kotlin-runtime:jar:1.0.3:compile 
[DEBUG] org.postgresql:postgresql:jar:9.4.1211:compile 
[DEBUG] commons-dbutils:commons-dbutils:jar:1.6:compile 
[DEBUG] com.h2database:h2:jar:1.4.191:compile 
[DEBUG] junit:junit:jar:4.12:compile 
[DEBUG] com.sun.jndi:ldap:jar:1.2.4:compile 
[DEBUG] com.github.seratch:kotliquery:jar:1.1.1:compile 
[DEBUG]  org.slf4j:slf4j-api:jar:1.7.21:compile 
[DEBUG]  joda-time:joda-time:jar:2.9.4:compile 
[DEBUG]  org.jetbrains.kotlin:kotlin-test-junit:jar:1.0.3:compile 
[DEBUG]   org.jetbrains.kotlin:kotlin-test:jar:1.0.3:compile 
[DEBUG] com.zaxxer:HikariCP:jar:2.4.7:compile 
[DEBUG] org.mockito:mockito-all:jar:1.9.5:compile 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.192 s 
[INFO] Finished at: 2016-11-09T16:42:31+01:00 
[INFO] Final Memory: 12M/123M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project gs-rest-service: Could not resolve dependencies for project org.springframework:gs-rest-service:war:0.1.0: Failure to find com.sun.jndi:ldap:jar:1.2.4 in https://repo.spring.io/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project gs-rest-service: Could not resolve dependencies for project org.springframework:gs-rest-service:war:0.1.0: Failure to find com.sun.jndi:ldap:jar:1.2.4 in https://repo.spring.io/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced 
     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 org.springframework:gs-rest-service:war:0.1.0: Failure to find com.sun.jndi:ldap:jar:1.2.4 in https://repo.spring.io/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced 
     at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:211) 
     at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195) 
     ... 23 more 
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Failure to find com.sun.jndi:ldap:jar:1.2.4 in https://repo.spring.io/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced 
     at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:384) 
     at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:205) 
     ... 24 more 
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find com.sun.jndi:ldap:jar:1.2.4 in https://repo.spring.io/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of spring-releases 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.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367) 
     ... 25 more 
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.sun.jndi:ldap:jar:1.2.4 in https://repo.spring.io/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of spring-releases 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) 
     ... 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 
+0

URL-адрес http: // mvnrepository.com/artifact/'не является репозиторием Maven. – khmarbaise

+0

попробуйте mvn -U clean install – jay

+0

@khmarbaise Я добавил его после возникновения этой ошибки, думая, что это может быть решение. Хотя он должен быть по умолчанию. И поскольку у меня есть несколько зависимостей оттуда, это не должно быть проблемой – Ivaro18

ответ

1

Я пытаюсь создать проект, имеющий LDAP (в частности com.sun.jndi.ldap.LdapCtxFactory) банку.

Класс, о котором вы упомянули, предоставлен JDK и JRE с 1.4. Вам не нужно ничего делать с Maven или чем-то еще, чтобы получить его.