我已经使用in-project repo usage中存在的溶液来解决这个问题。
Maven项目使用项目内资源库来托管项目特定的jar文件。运行mvn verify或mvn install时,抛出以下错误:
2019/01/07 03:05:42 [error] 85#85: *3 open() "/etc/nginx/html/sdfd" failed (2: No such file or directory), client: 172.17.0.1, server: www.dev.mywebsite.com.au, request: "GET /sdfd HTTP/2.0", host: "www.dev.mywebsite.com.au"
2019/01/07 03:05:42 [error] 85#85: *3 open() "/etc/nginx/html/my-s3-bucket/404.html" failed (2: No such file or directory), client: 172.17.0.1, server: www.dev.mywebsite.com.au, request: "GET /sdfd HTTP/2.0", host: "www.dev.mywebsite.com.au"
我还用[ERROR] Failed to execute goal on project Read: Could not resolve dependencies for project com.inc.slx:Read:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at local:scm:jar:1.0: Failed to read artifact descriptor for local:scm:jar:1.0: Could not transfer artifact local:scm:pom:1.0 from/to repo (C:\workspace-sts-3.9.6.RELEASE\Read\repo): Cannot access C:\workspace-sts-3.9.6.RELEASE\Read\repo with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access C:\workspace-sts-3.9.6.RELEASE\Read\repo using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: c
[ERROR] -> [Help 1]
[ERROR]
更新了settings.xml文件mirrorOf。
这是完整的pom.xml
"!repo,*"
回购文件夹的位置在:
<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>com.inc.slx</groupId>
<artifactId>Read</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>repo</id>
<name>project</name>
<url>${project.basedir}\repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>local</groupId>
<artifactId>scm</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>false</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.inc.broker.MainClass</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>