Java Maven忽略本地存储库位置更改
我正试图更改Mavens本地存储库的位置,但到目前为止还不起作用。 我目前正在学习quarkus的教程: 我将settings.xml中的localRepository设置更改为Java Maven忽略本地存储库位置更改,java,maven,repository,settings,quarkus,Java,Maven,Repository,Settings,Quarkus,我正试图更改Mavens本地存储库的位置,但到目前为止还不起作用。 我目前正在学习quarkus的教程: 我将settings.xml中的localRepository设置更改为 D:\Zubehoer\Maven\repository 并将settings.xml复制到我的用户主页中的.m2文件夹中。 如链接教程所示,当我编译mvn quarkus:dev时,依赖项将下载到默认存储库,而不是我更改本地存储库的位置 最后,项目的pom: <project xsi:schemaLocatio
D:\Zubehoer\Maven\repository
并将settings.xml复制到我的用户主页中的.m2文件夹中。
如链接教程所示,当我编译mvn quarkus:dev
时,依赖项将下载到默认存储库,而不是我更改本地存储库的位置
最后,项目的pom:
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.acme</groupId>
<artifactId>getting-started</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus-plugin.version>1.5.2.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.5.2.Final</quarkus.platform.version>
<surefire-plugin.version>2.22.1</surefire-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>
4.0.0
org.acme
因此默认情况下,mavens settings.xml的
属性位于注释中:
由于我只更改了localRepository属性的值,但没有将属性移到注释之外,因此它不起作用。因此默认情况下,mavens settings.xml的
属性位于注释内:
因为我只更改了localRepository属性的值,但没有将属性移到注释之外,所以它不起作用。您使用的是哪个IDE?Eclipse,但我没有使用Eclipse maven。我所做的一切都是在独立的maven上完成的。你看到了与mvn包-DskipTests
相同的问题吗?@AlexeyLoubyansky相同,与mvn包-DskipTests
@MichaelBerry一样,我认为我遇到了这个问题,并且我认为最终它是一个非常简单的问题。我没有完全意识到默认情况下localRepository属性在注释中,而WordPad中的视图并没有真正突出显示这一点。我只需按ctrl+f键搜索localRepos并更改了
中的值。如果它在注释中,那么它就不起作用了……您使用的是哪个IDE?Eclipse,但我没有使用Eclipse maven。我所做的一切都是在独立的maven上完成的。你看到了与mvn包-DskipTests
相同的问题吗?@AlexeyLoubyansky相同,与mvn包-DskipTests
@MichaelBerry一样,我认为我遇到了这个问题,并且我认为最终它是一个非常简单的问题。我没有完全意识到默认情况下localRepository属性在注释中,而WordPad中的视图并没有真正突出显示这一点。我只需按ctrl+f键搜索localRepos并更改了
中的值。有道理,如果评论里有这样的话,它就不起作用了。。。