简体   繁体   English

找不到在 netbeans 8.0.2 中设置 Maven 本地存储库路径的位置

[英]Can not find where maven local repository path in netbeans 8.0.2 is set

In netbeans when I go to Tools->Options->Java->Maven panel is showing Maven Home: Bundeled Maven Home在 netbeans 中,当我转到 Tools->Options->Java->Maven 面板时显示 Maven Home:Bundeled Maven Home

But I can not find in Netbeans 8.0.2 that where is the maven local repository path is as it can be seen in Netbeans 7.0.1但是我在 Netbeans 8.0.2 中找不到 Maven 本地存储库路径在哪里,因为它可以在 Netbeans 7.0.1 中看到

Maven local repository in 7.0.1 7.0.1 中的 Maven 本地存储库

In my system .m2 folder is located at C:\\Users\\acs\\.m2在我的系统中,.m2 文件夹位于C:\\Users\\acs\\.m2

But there is another repository at C:\\Users\\acs\\AppData\\Roaming\\NetBeans\\8.0.2\\config\\Preferences\\org\\netbeans\\modules\\maven但是在C:\\Users\\acs\\AppData\\Roaming\\NetBeans\\8.0.2\\config\\Preferences\\org\\netbeans\\modules\\maven有另一个存储库

Now I have installed apache-maven(which have not installed previously on sysetm) and set the MAVEN HOME path to C:\\Users\\acs\\apache-maven-3.3.9 in netbeans现在我已经安装了 apache-maven(之前没有在 sysetm 上安装过),并在 netbeans 中将 MAVEN HOME 路径设置为 C:\\Users\\acs\\apache-maven-3.3.9

And then wanted to know that currently at what location netbeans Maven local repository path is.然后想知道目前netbeans Maven 本地存储库路径在什么位置。 But I am unable to find it in 8.0.2但我无法在 8.0.2 中找到它

Does anyone know how to find it?有谁知道如何找到它?

Using external Maven installations, the local repository is (by default) in使用外部 Maven 安装,本地存储库(默认情况下)位于

${user.home}/.m2/repository

Check out Maven Settings or Maven Mini Guide查看Maven 设置Maven 迷你指南

You can set another local repository dir path, changing您可以设置另一个本地存储库目录路径,更改

Global settings全局设置

${maven.home}/conf/settings.xml

or

User settings用户设置

${user.home}/.m2/settings.xml



<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>/any_other_dir/repository</localRepository>
  
  ...
</settings>

If you do so, any project that use this Maven and this global/user settings, will use this repository as local repository.如果这样做,任何使用此 Maven 和此全局/用户设置的项目都将使用此存储库作为本地存储库。

Found the way.找到路了

In Project Explorer window within Netbeans you will find services tab.在 Netbeans 的 Project Explorer 窗口中,您将找到服务选项卡。

Goto: services->maven repositories->local->right click->properties转到: services->maven repositories->local->right click->properties

You will get the Local Repository path which netbeans is using.您将获得 netbeans 正在使用的本地存储库路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM