指定新的Maven存储库

时间:2012-04-24 12:11:01

标签: maven

美好的一天!

我在项目的pom.xml文件中指定了一个新的存储库。所以在标签之前我添加了这个配置

<repositories>
   <repository>
        <id>maven-db-plugin-repo</id>
        <name>maven db plugin repository</name>
        <url>http://maven-db-plugin.googlecode.com/svn/maven/repo</url>
        <layout>default</layout>
    </repository>
  </repositories>

表示here 但是,当我试图执行mvn db:update时,我收到了这个错误:

[ERROR] No plugin found for prefix 'db' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/andriy/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

对我做错了什么的建议? 感谢

更新

我也添加了这种依赖

<dependency> 
  <groupId>com.googlecode</groupId> 
  <artifactId>maven-db-plugin</artifactId> 
  <version>1.3</version> 
  <type>jar</type>
</dependency> 

仍然收到这些警告:

[WARNING] The POM for com.googlecode:maven-db-plugin:jar:1.3 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for com.googlecode:maven-db-plugin:1.3: Plugin com.googlecode:maven-db-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.googlecode:maven-db-plugin:jar:1.3

2 个答案:

答案 0 :(得分:3)

仅添加回购并不足以使插件正常工作。你也必须在你的pom中配置插件。有一个在project's home page底部配置maven-db-plugin的例子。

maven-sql-plugin有better documentation。如果它符合您的需求,您可以改用它。

答案 1 :(得分:2)

我认为您必须具备以下配置:

<pluginRepositories>
<pluginRepository>
  <id>maven-db-plugin-repo</id>
  <name>maven db plugin repository</name>
  <url>http://maven-db-plugin.googlecode.com/svn/maven/repo</url>
  <layout>default</layout>
</pluginRepository>