我正在尝试按照 Heroku 上的“将非托管依赖项添加到 Maven 项目”一文,将本地 JAR 依赖项添加到 java 项目。我一直卡在更新 Pom 文件部分,它告诉我添加/更新存储库元素。我将示例存储库元素添加到我的 pom.xml 文件中,当我尝试将代码推送到 heroku 时,我收到以下错误:
无法在项目 fuji 上执行目标:无法解析项目 com.example.fuji:fuji:jar:1.0-SNAPSHOT 的依赖项:在项目中找不到工件 com.example.tambora:Tambora:jar:0.0.1-SNAPSHOT。当地的
似乎我将存储库 ID 或名称元素命名为错误,但我不知道它们也应该更改什么。我能够在本地运行此应用程序而不会收到任何错误。
这是我的 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>
<groupId>com.example.fuji</groupId>
<artifactId>fuji</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Fuji</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>com.example.tambora</groupId>
<artifactId>Tambora</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>7.0.22</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>7.0.22</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>7.0.22</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>7.0.22</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper-el</artifactId>
<version>7.0.22</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>7.0.22</version>
</dependency>
</dependencies>
<build>
<finalName>fuji</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<assembleDirectory>target</assembleDirectory>
<programs>
<program>
<mainClass>launch.Main</mainClass>
<name>webapp</name>
</program>
</programs>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<!--other repositories if any-->
<repository>
<id>project.local</id>
<name>project</name>
<url>file:${project.basedir}/repo</url>
</repository>
</repositories>
</project>