gpt4 book ai didi

maven-schemaspy-plugin 不起作用(可能是存储库问题)

转载 作者:行者123 更新时间:2023-12-01 05:35:59 28 4
gpt4 key购买 nike

我想从集成在 maven 生命周期中的数据库生成一个 er-diagram。
SchemaSpy 生成 er-diagram 并且使用 maven-schemaspy-plugin 应该可以将其集成到生命周期过程中。
(如果有人对此有更好的想法,请告诉我)

我用以下简单的 pom.xml 尝试了它(它只应该生成 er-diagram);但插件没有启动;它甚至无法下载:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>test.schemaspy</groupId>
<artifactId>SchemaSpyGenerateDB_02</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>SchemaSpyGenerateDB_02</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>maven-plugins</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>maven-plugins</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
<type>plugin</type>
</dependency>
</dependencies>
<!-- To use the report goals in your POM or parent POM -->
<reporting>
<plugins>
<plugin>
<groupId>maven-plugins</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.1</version>
<configuration>
<databaseType>derby</databaseType>
<database>JPACertifiaction_Relationship</database>
<host>localhost</host>
<port>1527</port>
<user>user</user>
<password>password</password>
</configuration>
</plugin>
</plugins>
</reporting>
</project>

命令
mvn site:site

导致消息


maven-plugins:maven-schemaspy-plugin:jar:1.0 的 POM 丢失,没有可用的依赖信息


缺少 maven-plugins:maven-schemaspy-plugin:plugin:1.0 的 POM,没有可用的依赖信息


我也用以下设置尝试过,但没有成功:

<dependency>
<groupId>com.wakaleo.schemaspy</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>5.0.1</version>
</dependency>
....
<reporting>
<plugins>
<plugin>
<groupId>com.wakaleo.schemaspy</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>5.0.1</version>
....
<repository>
<id>Wakaleo Repository</id>
<url>http://maven.wakaleo.com/mojo/maven-schemaspy-plugin/</url>
</repository>

我还感到困惑的是,不同版本的 1.0/5.0.1 有不同的存储库,那么真正的官方存储库是什么?

最佳答案

你不需要这些条目

  <dependencies>
<dependency>
<groupId>maven-plugins</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>maven-plugins</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
<type>plugin</type>
</dependency>
</dependencies>

删除它们。当您定义一个插件(稍后的插件部分)时,它会被 maven 自动下载。您的错误消息说缺少 1.0,但您的插件是 1.1,因此无论如何它都不适合您的依赖项。

maven-schemaspy-plugin 和 com.wakaleo.schemaspy 插件是来自不同作者的不同插件。它们都不是“官方 schemaspy”maven 插件。我只能使用 wakaleo 插件(使用 maven 3)解决它。其他插件接缝不再可用。

使用 Maven 3,站点生成发生了变化,请参阅 site generation in Maven 3 .正如这篇博客文章中提到的,您必须以这种方式包含插件(请注意,版本控制已更改):

        <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.1</version>
<configuration>
<reportPlugins>
<plugin>
<groupId>com.wakaleo.schemaspy</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0.4</version>
<configuration>
<databaseType>derby</databaseType>
<database>JPACertifiaction_Relationship</database>
<host>localhost</host>
<port>1527</port>
<user>user</user>
<password>password</password>
</configuration>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>

并且您需要指向存储库的链接:

<pluginRepositories>
<pluginRepository>
<id>Wakaleo Repository</id>
<url>http://www.wakaleo.com/maven/repos/</url>
</pluginRepository>
</pluginRepositories>

然后插件启动。剩下的就靠你了:-)

关于maven-schemaspy-plugin 不起作用(可能是存储库问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8765661/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com