2012-04-24 53 views
0

美好的一天!指定新的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 

回答

3

只要添加一个回购协议是不够的,让一个插件的工作。你也必须在你的pom中配置插件。在project's home page的底部有一个配置maven-db-plugin的例子。

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

+0

发布的maven-DB-插件配置,仍然有同样的错误。也许我把它放在错误的地方? – andriy 2012-04-24 19:14:28

+0

[pom参考资料](http://maven.apache.org/pom.html)显示了所有东西都属于pom,[包括插件](http://maven.apache.org/pom.html#Plugins) 。 – 2012-04-24 21:09:34

+0

我对很多问题感到抱歉,但现在我对maven很新颖。我还添加了这种依赖' com.googlecode 的maven-DB-插件 1.3 罐子 ' 但还是收到这些警告:'[警告]为COM的POM。 googlecode:maven-db-plugin:jar:1.3缺失,不存在依赖信息[警告]无法检索com.googlecode的插件描述符:maven-db-plugin:1.3:插件com.googlecode:maven-db-plugin: 1.3或其某个依赖关系无法解决:辉...' – andriy 2012-04-24 22:01:50

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>