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
最满意答案
该方法仅创建表 ; 因此,您需要确保已创建数据库。
数据库必须存在,如果表已经存在,您将收到数据库中的错误。 它不会覆盖或删除表。
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.
相关问答
更多-
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' If ...
-
MySQL检查数据库是否存在(MySQL Check if a database exists)[2021-10-20]
尝试: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'DBName' 如果不存在,您将获得一个空的结果集。 如果您需要知道数据库是否存在以避免在尝试创建它时出错: CREATE DATABASE IF NOT EXISTS; Try: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'DBName ... -
该方法仅创建表 ; 因此,您需要确保已创建数据库。 数据库必须存在,如果表已经存在,您将收到数据库中的错误。 它不会覆盖或删除表。 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 d ...
-
也许你正在寻找这个: void createDB(){ new OServerAdmin("remote:localhost") .connect("root", "rootPassword") .createDatabase("databaseName", "graph", "plocal").close(); } 看到这里 。 更新: 在上面,如果数据库已经存在,则会抛出异常。 也许你会发现这些方法更有用: private static fina ...
-
结束在我的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.localDatabaseDoes ...
-
检查数据库是否存在(Check if database exist)[2020-02-08]
您可以使用-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/Backups ... -
使用openDatabase命令而不是create。 如果数据库不存在,这将创建数据库。 试试这篇文章 https://www.thepolyglotdeveloper.com/2015/12/use-sqlite-in-ionic-2-instead-of-local-storage/ 另外我建议在$ ionicPlatform.ready开头使用这个命令并将它保存在某个全局变量中,这样你就可以在应用程序中随时访问它。 我一直在使用离子v1的sqlite插件。 上面的链接将帮助您将其与离子v2集成。 Us ...
-
你可以使用File.Exists : if (!File.Exists(mdbPath)) CreateAccessDatabase(mdbPath); You can just use File.Exists: if (!File.Exists(mdbPath)) CreateAccessDatabase(mdbPath);
-
我能想到的最简单的方法是: 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 couchd ...
-
答案是使用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_id','= ...