2012-04-24 75 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>