1

我正在尝试让 Maven 站点运行。但是现在四个小时我遇到了依赖问题。

当我运行 Maven 时,我遇到了这个失败

[警告] 无法从存储库为 org.scannotation:scannotation:pom:1.0.3 创建 Maven 项目。org.apache.maven.project.ProjectBuildingException: Error resolve project artifact: Failure to find org.scannotation:scannotation:pom:1.0.3 in http://repo.maven.apache.org/maven2被缓存在本地存储库中,直到中央的更新间隔已经过去或对项目 org.scannotation:scannotation:pom:1.0.3 强制更新,才会重新尝试解析

这是我的 pom - 文件:

<?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>de.klinikumlmu.server</groupId>
    <artifactId>KlinikumServer</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>KlinikumServer</name>

    <properties>
        <sesame.version>2.7.0</sesame.version>
        <resteasy.version>2.3.6.Final</resteasy.version>
        <slf4j.version>1.7.5</slf4j.version>
        <arquillian.version>1.0.3.Final</arquillian.version>
        <shrinkwrap-bom.version>1.1.2</shrinkwrap-bom.version>
        <shrinkwrap-resolver-bom.version>2.0.0-beta-3</shrinkwrap-resolver-bom.version>
        <junit.version>4.8.1</junit.version>
        <apache-http.version>4.2.4</apache-http.version>
        <apache-commons.version>1.3.2</apache-commons.version>
        <maven-compiler.version>3.1</maven-compiler.version>
        <maven-war.version>2.3</maven-war.version>
        <maven-surefire.version>2.12</maven-surefire.version>
        <maven-checkstyle.version>2.10</maven-checkstyle.version>
    </properties>
    <packaging>war</packaging>

    <dependencyManagement>

        <dependencies>
            <dependency>
                <groupId>org.jboss.spec</groupId>
                <artifactId>jboss-javaee-6.0</artifactId>
                <version>1.0.0.Final</version>
                <type>pom</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.shrinkwrap</groupId>
                <artifactId>shrinkwrap-bom</artifactId>
                <version>${shrinkwrap-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.shrinkwrap.resolver</groupId>
                <artifactId>shrinkwrap-resolver-bom</artifactId>
                <version>${shrinkwrap-resolver-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${arquillian.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.scannotation</groupId>
                <artifactId>scannotation</artifactId>
                <version>1.0.3</version>
                </dependency>       
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.12.1.GA</version>
        </dependency>

        <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>tomee-embedded</artifactId>
            <version>1.5.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0-5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrdf.sesame</groupId>
            <artifactId>sesame-runtime</artifactId>
            <version>${sesame.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>${resteasy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-cdi</artifactId>
            <version>${resteasy.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.resteasy</groupId>
                    <artifactId>resteasy-jaxrs</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxb-provider</artifactId>
            <version>${resteasy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>${apache-http.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${apache-http.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>${apache-commons.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>arquillian-tomee-embedded</artifactId>
            <version>1.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.6</version>
            <type>maven-plugin</type>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <warSourceDirectory>WebContent</warSourceDirectory>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.openejb.maven</groupId>
                <artifactId>tomee-maven-plugin</artifactId>
                <version>1.5.2</version>
                <configuration>
                    <tomeeVersion>1.5.2</tomeeVersion>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.10</version>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                 <locales>en</locales>
                </configuration>
                </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12</version>
            </plugin>
        </plugins>
    </reporting>
</project>

我尝试了很多不同版本的不同方法来将 jar 直接与构建路径连接起来。

4

1 回答 1

0

确保您为扫描注释库设置了正确的存储库。

根据mavenhub.com ,这应该在您的pom.xml或您的中声明settings.xml

<repository>
    <id>thirdparty-releases</id>
    <name>JBoss Thirdparty Releases</name>
    <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>
</repository>
于 2013-05-17T13:38:07.333 回答