gpt4 book ai didi

java - 从 JPA 实体查找用于 DDL 生成的 jpa-ddl-maven-plugin 时出错

转载 作者:行者123 更新时间:2023-12-01 14:06:30 29 4
gpt4 key购买 nike

我正在尝试使用jpa-ddl-maven-plugin,如here所述但我使用 Apache Maven 3.0.3 时收到以下错误。有什么想法我哪里出错了吗?

我的 pom.xml:

<plugin>

<groupId>it.linksmt.tooling</groupId>

<artifactId>maven-jpa-ddl-plugin</artifactId>

<version>1.0.0-SNAPSHOT</version>

<extensions>true</extensions>

<configuration>

<targetDbPlatform>OraclePlatform</targetDbPlatform>

<persistenceUnitName>test-entity-api</persistenceUnitName>

<persistenceUnitFile>META-INF/persistence.xml</persistenceUnitFile>

</configuration>

</plugin>

settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
<pluginGroup>it.linksmt.tooling</pluginGroup>
</pluginGroups>
</settings>

错误:

WARNING] The POM for it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.test.sample:sample-api:1.0.0-SNAPSHOT (/project/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

mvn clean install -e 输出:

ERROR]   
[ERROR] The project com.test:sample:sample-api:1.0.0-SNAPSHOT (/project/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT -> [Help 2]
org.apache.maven.plugin.PluginResolutionException: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:215)
at org.apache.maven.project.DefaultProjectBuildingHelper.resolveExtensionArtifacts(DefaultProjectBuildingHelper.java:377)
at org.apache.maven.project.DefaultProjectBuildingHelper.createProjectRealm(DefaultProjectBuildingHelper.java:237)
at org.apache.maven.project.DefaultModelBuildingListener.buildExtensionsAssembled(DefaultModelBuildingListener.java:106)
at org.apache.maven.model.building.ModelBuildingEventCatapult$1.fire(ModelBuildingEventCatapult.java:43)
at org.apache.maven.model.building.DefaultModelBuilder.fireEvent(DefaultModelBuilder.java:1041)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:391)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:374)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:536)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:542)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:542)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:328)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:632)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:581)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:233)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:541)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:395)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:207)
... 26 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:531)
... 29 more

最佳答案

您正在尝试使用 SNAPSHOT插件的版本,在 Maven 的默认存储库中找不到该插件 - Maven Central .
查看插件Google代码页,目前似乎处于测试阶段,没有发布版本。
您有几个选项可以解决此插件问题:

  1. 按照描述从源代码构建它 here并将其安装到本地 Maven 存储库。这仅在您的机器上有用。
  2. 构建插件并 deploy它到存储库管理器,例如 Artifactory 。这将帮助您与其他团队成员/CI 服务器共享插件。
  3. 从此repository解析插件。请注意,我通过搜索 Google 找到了它,但不知道是谁在管理它。您必须定义一个新的 repository为此。

关于java - 从 JPA 实体查找用于 DDL 生成的 jpa-ddl-maven-plugin 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18860032/

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