我正在使用 maven 在 apache-tomcat7 上部署一个应用程序,但它给出了依赖错误,就像这样
com.moteve:moteve-server-core:jar:0.1-SNAPSHOT
尝试从项目网站手动下载文件。
然后,使用以下命令安装它:
mvn install:install-file -DgroupId=com.moteve -DartifactId=moteve-server-c
ore -Dversion=0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
或者,如果您托管自己的存储库,则可以在那里部署文件:
mvn deploy:deploy-file -DgroupId=com.moteve -DartifactId=moteve-server-cor
e -Dversion=0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Drepo
sitoryId=[id]
Path to dependency:
1) com.moteve:moteve-server-webapp:war:0.1-SNAPSHOT
2) com.moteve:moteve-server-core:jar:0.1-SNAPSHOT
缺少 1 个必需的工件。
对于工件:
com.moteve:moteve-server-webapp:war:0.1-SNAPSHOT
从指定的远程存储库:中央(http://repo1.maven.org/maven2)
这是我的 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
enter code here
<parent>
<groupId>com.moteve</groupId>![enter image description here][1]
<artifactId>moteve-server-parent</artifactId>
<version>${moteve-server-parent-version}</version>
<relativePath>../moteve-server-parent/pom.xml</relativePath>
</parent>
<groupId>com.moteve</groupId>
<artifactId>moteve-server-webapp</artifactId>
<packaging>war</packaging>
<version>${moteve-server-webapp-version}</version>
<name>Moteve Web Application</name>
<url>http://moteve.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.moteve</groupId>
<artifactId>moteve-server-core</artifactId>
<version>${moteve-server-core-version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j-version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet-api-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-webmvc-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>moteve-server-webapp</finalName>
</build>
</project>