使用maven将jar上传到Archiva存储库

时间:2014-01-22 06:32:40

标签: maven jar pom.xml

我正在尝试使用maven在apache-archiva内部存储库中部署jar(javax.mail jar)。我知道我们可以手动轻松完成这项工作,但我想用maven尝试一下。我的Pom.xml如下:

* HTTP://maven.apache.org/maven-v4_0_0.xsd“>     4.0.0     com.tripod.demo     KARTHIK项目     战争     0.0.1-SNAPSHOT     Karthik-project Maven Webapp

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.5</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.3.Final</version>
            <configuration>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
                <version>1.4.5</version>
                <filename>/home/smadugula/mail-1.4.5.jar</filename>
            </configuration>
        </plugin>
    </plugins>
</build>
<distributionManagement>
    <repository>
        <id>archiva.internal</id>
        <name>Internal Release Repository</name>
        <url>http://localhost:8080/archiva/repository/internal</url>
    </repository>
    <snapshotRepository>
        <id>archiva.snapshots</id>
        <name>Internal Snapshot Repository</name>
        <url>http://localhost:8080/archiva/repository/snapshots/</url>
    </snapshotRepository>
</distributionManagement>

*

我正在用它来执行它:

mvn deploy:deploy-file -Durl=/home/smadugula/mail-1.4.5.jar \
                       -DrepositoryId= \
                       -Dfile=/home/smadugula/Karthik-project/target/Karthik-project-0.0.1-SNAPSHOT.jar \
                       -DpomFile=/MavenWorkspace/Karthik-project/pom.xml \

但问题是,当我这样做时,我不断收到如下错误:

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project Karthik-project: /home/smadugula/Karthik-project/target/Karthik-project-0.0.1-SNAPSHOT.jar not found.

我更改了settings.xml文件,但我无法弄清楚如何编辑pom。谁能帮助我如何配置我的pom以便这样做?

提前致谢

0 个答案:

没有答案