How to configure authentication for access of repository in pom.xml?

2.7k views Asked by At

When I building the project with dependencies by maven, it tried to download https://sweb.science.unitn.it/archiva/repository/internal/it/unitn/disi/sweb/sweb-utils/2.3-FINAL/sweb-utils-2.3-FINAL.pom. And its access was denied by the server. Although I have authentication to access this repository, I don't know how to configure pom.xml. In below I put my errors. Thanks in advance.

[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 is as follows:

<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>

0

There are 0 answers