Java 如何在pom.xml中配置访问存储库的身份验证?

Java 如何在pom.xml中配置访问存储库的身份验证?,java,maven,repository,pom.xml,Java,Maven,Repository,Pom.xml,当我用maven的依赖项构建项目时,它试图下载。服务器拒绝了它的访问。 虽然我拥有访问此存储库的身份验证,但我不知道如何配置pom.xml。我把我的错误放在下面。提前谢谢 [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for it.unitn.disi.sweb.ukc:ukc-dataimport-wor

当我用maven的依赖项构建项目时,它试图下载。服务器拒绝了它的访问。 虽然我拥有访问此存储库的身份验证,但我不知道如何配置pom.xml。我把我的错误放在下面。提前谢谢

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for it.unitn.disi.sweb.ukc:ukc-dataimport-wordnet:jar:1.0-SNAPSHOT
[WARNING] The expression ${version} is deprecated. Please use ${project.version} instead.
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ukc-dataimport-wordnet 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://sweb.science.unitn.it/archiva/repository/internal/it/unitn/disi/sweb/sweb-utils/2.3-FINAL/sweb-utils-2.3-FINAL.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.350 s
[INFO] Finished at: 2015-06-10T15:09:05+01:00
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ukc-dataimport-wordnet: Could not resolve dependencies for project it.unitn.disi.sweb.ukc:ukc-dataimport-wordnet:jar:1.0-SNAPSHOT: Failed to collect dependencies at it.unitn.disi.sweb:sweb-utils:jar:2.3-FINAL: Failed to read artifact descriptor for it.unitn.disi.sweb:sweb-utils:jar:2.3-FINAL: Could not transfer artifact it.unitn.disi.sweb:sweb-utils:pom:2.3-FINAL from/to sweb-internal (https://sweb.science.unitn.it/archiva/repository/internal): Access denied to https://sweb.science.unitn.it/archiva/repository/internal/it/unitn/disi/sweb/sweb-utils/2.3-FINAL/sweb-utils-2.3-FINAL.pom. Error code 401, Unauthorized -> [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/DependencyResolutionException
Pom.xml如下所示:

<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>it.unitn.disi.sweb.ukc</groupId>
<artifactId>ukc-dataimport-wordnet</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>

<name>ukc-dataimport-wordnet</name>
<url>http://disi.unitn.it/~knowdive</url>

<properties>
    <maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>it.unitn.disi.sweb</groupId>
        <artifactId>sweb-utils</artifactId>
        <version>2.3-FINAL</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <archive>
                    <compress>false</compress>
                    <manifestEntries>
                        <version>${version}</version>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <descriptors>
                    <descriptor>bin.xml</descriptor>
                </descriptors>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <goals>
                        <goal>attached</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>           
    </plugins>
</build>

<repositories>
    <repository>
        <id>sweb-internal</id>
        <layout>default</layout>
        <name>Archiva Managed Internal Repository</name>
        <url>https://sweb.science.unitn.it/archiva/repository/internal</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>sweb-snapshots</id>
        <name>Archiva Managed Snapshot Repository</name>
        <url>https://sweb.science.unitn.it/archiva/repository/snapshots</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

<distributionManagement>
    <repository>
        <id>sweb-internal</id>
        <name>UNITN Maven 2 Repository</name>
        <url>https://sweb.science.unitn.it/archiva/repository/internal</url>
    </repository>
    <snapshotRepository>
        <id>sweb-snapshots</id>
        <name>UNITN Maven 2 Repository</name>
        <url>https://sweb.science.unitn.it/archiva/repository/snapshots</url>
    </snapshotRepository>
</distributionManagement>

<scm>
    <connection>scm:svn:https://sweb.science.unitn.it/svn/ukc/development/wordnet_importer/trunk</connection>
    <developerConnection>scm:svn:https://sweb.science.unitn.it/svn/ukc/development/wordnet_importer/trunk</developerConnection>
</scm>

4.0.0
it.unitn.disi.sweb.ukc
ukc数据导入wordnet
罐子
1.0-快照
ukc数据导入wordnet
http://disi.unitn.it/~z~知道吗
每天
UTF-8
it.unitn.disi.sweb
瑞典人
2.3-决赛
org.apache.maven.plugins
maven编译器插件
2.3.1
1.6
1.6
org.apache.maven.plugins
maven jar插件
2.3.1
假的
${version}
maven汇编插件
bin.xml
组装
附属的
sweb内部
违约
Archiva管理的内部存储库
https://sweb.science.unitn.it/archiva/repository/internal
真的
总是
假的
sweb快照
Archiva托管快照存储库
https://sweb.science.unitn.it/archiva/repository/snapshots
假的
真的
总是
sweb内部
UNITN Maven 2存储库
https://sweb.science.unitn.it/archiva/repository/internal
sweb快照
UNITN Maven 2存储库
https://sweb.science.unitn.it/archiva/repository/snapshots
scm:svn:https://sweb.science.unitn.it/svn/ukc/development/wordnet_importer/trunk
scm:svn:https://sweb.science.unitn.it/svn/ukc/development/wordnet_importer/trunk

Post pom.xml示例。并存储此信息。此外,还应该在那里配置这些存储库的身份验证。另见@khmarbaise,非常感谢。它起作用了。