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

Любые предложения о том, что я «Неправильно? Благодаря

Update

Я также добавил эту зависимость

<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

Просто добавив репозиторий не достаточно, чтобы сделать плагиновую работу. Вам также нужно настроить плагин в вашем помпе. Пример настройки maven-db-plugin внизу project's home page.

В maven-sql-plugin есть better documentation. Если это соответствует вашим потребностям, вы можете просто использовать это вместо этого.

+0

Добавлено конфигурацию Maven-дб-плагин после тега и еще такая же ошибка. Может, я помещу его в неправильное место? – andriy

+0

Ссылка [pom reference] (http://maven.apache.org/pom.html) показывает, где все принадлежит pom, [включая плагины] (http://maven.apache.org/pom.html#Plugins) , –

+0

Прошу прощения за слишком много вопросов, но теперь я очень новичок в maven. Я также добавил эту зависимость ' com.googlecode Maven-DB-плагин 1,3 баночки ' И еще получать эти предупреждения: '[ПРЕДУПРЕЖДЕНИЕ] П для ком. googlecode: maven-db-plugin: jar: отсутствует 1.3, недоступна информация о зависимости [WARNING] Не удалось получить дескриптор плагина для com.googlecode: maven-db-plugin: 1.3: Плагин com.googlecode: maven-db-plugin: 1.3 или одна из его зависимостей не может быть решена: Fai ... ' – andriy

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> 
Смежные вопросы