0

再会!

我在项目的 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>

就像这里指出的 但是,当我尝试执行时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
4

2 回答 2

3

仅仅添加一个 repo 不足以使插件工作。你也必须在你的 pom 中配置插件。在项目主页的底部有一个配置 maven-db-plugin 的示例。

maven-sql-plugin 有更好的文档。如果它符合您的需求,您可以改用它。

于 2012-04-24T12:17:07.773 回答
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>
于 2013-01-24T14:46:00.647 回答