Maven 3主机如何与Maven 2不同?(how is Maven 3 host look up different to Maven 2?)

我正在努力从Maven 2迁移到Maven 3.我故意从消息和设置中删除了主机和端口。

Maven 2目前可以与我们在防火墙后面设置的Artifactory中央存储库一起使用。 当我切换到使用Maven 3时,无法下载带有错误消息的插件:

[错误]插件org.apache.maven.plugins:maven-install-plugin:2.3.1或其中一个依赖项无法解析:无法读取org的工件描述符。 apache.maven.plugins:maven-install-plugin:jar:2.3.1:无法传输工件org.apache.maven.plugins:maven-install-plugin:pom:2.3.1 from / to central(http:// :/ artifactory / plugins-release):拒绝访问:http://:/artifactory/plugins-release/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3 .1.pom,ReasonPhrase:禁止。

这是我的设置:

    <?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<proxies>
    <proxy>
      <id>andy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxyip</host>
      <port>80</port>
      <username>user</username>
      <password>password</password>
      <nonProxyHosts>host</nonProxyHosts>
    </proxy> 
  </proxies>
      <servers>
        <server>
          <username>user</username>
          <password>password</password>
          <id>central</id>
        </server>
        <server>
      <username>user</username>
      <password>password</password>
      <id>snapshots</id>
    </server>
  </servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://<host>:<port>/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://<host>:<port>/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>plugins-release</name>
          <url>http://<host>:<port>/artifactory/plugins-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>plugins-snapshot</name>
          <url>http://<host>:<port>/artifactory/plugins-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

我已检查过神器中是否​​存在正确的插件和版本,这似乎是一个访问问题。 在配置需要更新的Maven 2和Maven 3之间有什么变化吗?


I am working to migrate from Maven 2 to Maven 3. I have purposely removed the host and port from the messages and settings.

Maven 2 currently works fine with the Artifactory central repository we have setup behind a firewall. When I switch to using Maven 3 it fails to download the plugins with the error message:

[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org. apache.maven.plugins:maven-install-plugin:jar:2.3.1: Could not transfer artifact org.apache.maven.plugins:maven-install-plugin:pom:2.3.1 from/to central (http:/ /:/artifactory/plugins-release): Access denied to: http://:/artifactory/plugins-release/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom , ReasonPhrase:Forbidden.

Here are my settings:

    <?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<proxies>
    <proxy>
      <id>andy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxyip</host>
      <port>80</port>
      <username>user</username>
      <password>password</password>
      <nonProxyHosts>host</nonProxyHosts>
    </proxy> 
  </proxies>
      <servers>
        <server>
          <username>user</username>
          <password>password</password>
          <id>central</id>
        </server>
        <server>
      <username>user</username>
      <password>password</password>
      <id>snapshots</id>
    </server>
  </servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://<host>:<port>/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://<host>:<port>/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>plugins-release</name>
          <url>http://<host>:<port>/artifactory/plugins-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>plugins-snapshot</name>
          <url>http://<host>:<port>/artifactory/plugins-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

I have checked that the correct plugin and version exists in artifactory, this does seem to be an access issue. Has something changed between Maven 2 and Maven 3 where the configuration needs updating?


原文:https://stackoverflow.com/questions/17611382
2022-08-01 08:08

满意答案

该方法仅创建表 ; 因此,您需要确保已创建数据库。

数据库必须存在,如果表已经存在,您将收到数据库中的错误。 它不会覆盖或删除表。


The method only creates tables; so it is up to you to make sure the database is already created.

The database has to exist and if the table already exists, you'll receive an error from the database. It will not overwrite or delete tables.

相关问答

更多

如何检查mysql数据库是否存在(How to check if mysql database exists)

SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'DBName' 如果您只需要知道db是否存在,那么当您尝试创建数据时,您将不会收到错误,只需使用(从此处 ): CREATE DATABASE IF NOT EXISTS DBName; SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'DBName...

MySQL检查数据库是否存在(MySQL Check if a database exists)

尝试: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'DBName' 如果不存在,您将获得一个空的结果集。 如果您需要知道数据库是否存在以避免在尝试创建它时出错: CREATE DATABASE IF NOT EXISTS <name>; Try: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'D...

db.create_all()是否检查数据库是否存在?(Does db.create_all() check if the database exists?)

该方法仅创建表 ; 因此,您需要确保已创建数据库。 数据库必须存在,如果表已经存在,您将收到数据库中的错误。 它不会覆盖或删除表。 The method only creates tables; so it is up to you to make sure the database is already created. The database has to exist and if the table already exists, you'll receive an error from ...

Orient DB - 使用密码创建orient db,并检查是否有可用的JAVA(Orient DB - create orient db with password and check if one available using JAVA)

也许你正在寻找这个: void createDB(){ new OServerAdmin("remote:localhost") .connect("root", "rootPassword") .createDatabase("databaseName", "graph", "plocal").close(); } 看到这里 。 更新: 在上面,如果数据库已经存在,则会抛出异常。 也许你会发现这些方法更有用: private static...

检查Appcelerator区域设置数据库是否存在(Check if Appcelerator locale database exists)

结束在我的index.js中执行此操作,因为我发现它是一个可靠的选项。 var db = Ti.Database.open("workoutsDB"); try { var rows = db.execute('SELECT * FROM workouts ORDER BY date DESC'); rows.close(); //If this code block runs the local database exist. Alloy.Globals.localDatabas...

检查数据库是否存在(Check if database exist)

您可以使用-e bash命令检查文件是否存在。 MongoDB为每个数据库创建一个Namespace文件,因此搜索这些文件。 就像是 if [ -e /data/db/$DBNAME.ns ]; then `mongodump -d $DBNAME --out /backup/directory` fi 假设您的数据存储在/ data / db中 查看mongodump命令,该命令可用于从mongo db实例备份数据http://www.mongodb.org/display/DOCS/Ba...

Ionic SQLite - 检查数据库是否存在(Ionic SQLite — check if database exists)

使用openDatabase命令而不是create。 如果数据库不存在,这将创建数据库。 试试这篇文章 https://www.thepolyglotdeveloper.com/2015/12/use-sqlite-in-ionic-2-instead-of-local-storage/ 另外我建议在$ ionicPlatform.ready开头使用这个命令并将它保存在某个全局变量中,这样你就可以在应用程序中随时访问它。 我一直在使用离子v1的sqlite插件。 上面的链接将帮助您将其与离子v2集...

如果不创建访问数据库(.mbd),请检查它是否存在(Check if an access database (.mbd) exists if not create it)

你可以使用File.Exists : if (!File.Exists(mdbPath)) CreateAccessDatabase(mdbPath); You can just use File.Exists: if (!File.Exists(mdbPath)) CreateAccessDatabase(mdbPath);

python-couchdb:如何检查数据库是否已经存在(How to check if database already exists)

我能想到的最简单的方法是: import couchdb server = couchdb.Server("http://localhost:5984") "dataBaseName" in server 如果存在名称的数据库,则返回True ,否则返回False https://github.com/djc/couchdb-python/blob/master/couchdb/client.py#L90-L101 The easiest way I can think is: import c...

检查数据库中是否存在该行(check if the row exists or not in the database)

答案是使用count函数: public function postIndex(Request $request){ $id=$request->input('id'); $user_id=Auth::user()->id; $product_id =$request['product_id']; $wishlist=DB::table('wishlist') ->where('user_i...

相关文章

更多

maven 小问题

用mvn archetype:generate -DgroupId=com.shxt.maven -D ...

Running Solr with Maven

Solris an open source search server which is built ...

maven需求、下载与安装

下载地址:http://maven.apache.org/download.cgi 最新版本是3.1: ...

maven环境快速搭建

第一步:配置maven环境 将下载文件解压,然后设置maven环境 如果你配置过jdk的话,这里对你应 ...

创建maven webapp项目

现在的项目,只有一个pom.xml文件 在现在的项目上创建一个maven模块 模块名称为web 选择m ...

maven设置HTTP代理访问

使用maven下载依赖文件的时候,如果出现could not be retrieved from re ...

在linux环境下安装Maven

本配置是在centos6.5环境下的配置,和其他linux下配置是一样的 http://maven.a ...

maven下载与安装

下载地址:http://maven.apache.org/download.cgi 最新版本:apac ...

maven设置本地仓库

更改本地仓库 maven安装好之后,本地仓库默认在当前用户所在目录的.m2目录下。如 C:\Users ...

使用Maven运行Solr(翻译)

Solr是一个使用开源的搜索服务器,它采用Lucene Core的索引和搜索功能构建,它可以用于几乎所 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本