运行Maven构建时出现问题的问题,如何解决?

时间:2020-05-08 14:50:24

标签: java maven jive

我正在尝试使用Maven构建Java项目,但由于此错误而陷入困境。我尝试过mvn -U clean install,尝试从同事那里获取存储库文件夹,但没有任何帮助。

这是错误消息。似乎没有必要的依赖关系,但由于它不是直接依赖关系-我不知道如何解决它。

[ERROR] Failed to execute goal on project project-name: Could not resolve dependencies for project ru.company-name.jive:project-name:jar:9.0.7.1: Failed to collect dependencies at com.jivesoftware:jive-core:jar:9.0.7.1_1276_18c97f6 -> com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:jar:1.1 -> com.google.guava:guava:jar:24.0-android-SNAPSHOT: Failed to read artifact descriptor for com.google.guava:guava:jar:24.0-android-SNAPSHOT: Could not find artifact com.google.guava:guava-parent:pom:24.0-android-20170926.205728-110 in mygrid (http://repository.mygrid.org.uk/artifactory/remote-repos) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project project-name: Could not resolve dependencies for project ru.company-name.jive:project-name:jar:9.0.7.1: Failed to collect dependencies at com.jivesoftware:jive-core:jar:9.0.7.1_1276_18c97f6 -> com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:jar:1.1 -> com.google.guava:guava:jar:24.0-android-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:248)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
    ...
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project ru.company-name.jive:project-name:jar:9.0.7.1: Failed to collect dependencies at com.jivesoftware:jive-core:jar:9.0.7.1_1276_18c97f6 -> com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:jar:1.1 -> com.google.guava:guava:jar:24.0-android-SNAPSHOT
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:178)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
    ...
    at java.lang.reflect.Method.invoke (Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at com.jivesoftware:jive-core:jar:9.0.7.1_1276_18c97f6 -> com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:jar:1.1 -> com.google.guava:guava:jar:24.0-android-SNAPSHOT
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:291)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:284)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:169)
    ...
    at java.lang.reflect.Method.invoke (Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.google.guava:guava:jar:24.0-android-SNAPSHOT
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:301)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor (DefaultArtifactDescriptorReader.java:171)
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.resolveCachedArtifactDescriptor (DefaultDependencyCollector.java:541)
    ...
    at java.lang.reflect.Method.invoke (Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.google.guava:guava-parent:pom:24.0-android-20170926.205728-110 in mygrid (http://repository.mygrid.org.uk/artifactory/remote-repos)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel (DefaultModelResolver.java:176)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel (DefaultModelResolver.java:222)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally (DefaultModelBuilder.java:1070)
    ...
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.google.guava:guava-parent:pom:24.0-android-20170926.205728-110 in mygrid (http://repository.mygrid.org.uk/artifactory/remote-repos)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:424)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:207)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel (DefaultModelResolver.java:172)
    ...
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[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

这是我的pom.xml:

<?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>ru.mycompany.jive</groupId>
    <artifactId>ru-mycompany-core</artifactId>
    <name>ru-mycompany-core</name>
    <version>${build.version}</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>com.jivesoftware.maven</groupId>
        <artifactId>jive-parent-pom</artifactId>
        <version>9.0.7.1-0</version>
    </parent>

    <properties>
        <final.name>${project.artifactId}-${build.version}</final.name>
        <build.assembly.format>jar</build.assembly.format>
        <build.version>9.0.7.1</build.version>
    </properties>

    <distributionManagement>
        <repository>
            <id>mycompany-artifactory-central</id>
            <url>https://repo.mycompany.ru/artifactory/jive-release</url>
        </repository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>google-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <finalName>${final.name}</finalName>
        <outputDirectory>${project.build.directory}/classes</outputDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <!-- Unpackages this Jive plugin. Used in conjunction with the -DpluginDirs= property -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.jivesoftware</groupId>
            <artifactId>jive-core</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>${servlet.api.artifactId}</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0-m10</version>
            <scope>provided</scope>
        </dependency>
        <!-- Jersey Client -->
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
            <version>1.18.2</version>
        </dependency>

    </dependencies>

</project>

0 个答案:

没有答案