gpt4 book ai didi

maven - 在 Netbeans 中从 Github 创建库 .jar

转载 作者:太空宇宙 更新时间:2023-11-04 06:40:44 25 4
gpt4 key购买 nike

我正在尝试使用 GitHub 上提供的库 ( MailChimp API Wrapper for Java )。不幸的是,他们不以直接下载的方式分发库类路径 .jar 或 javadocs。

尝试自己构建类路径.jar,我下载了包含Netbeans项目的.zip文件并打开了Netbeans项目(这是一个Maven项目......我对Maven不太熟悉)。我尝试清理和构建该项目(希望它能够生成一个漂亮的 .jar,我可以将其导入到我的其他项目中)。

enter image description here

但是,清理和构建失败并显示以下消息:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.2:test (default-test) on project ecwid-mailchimp: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.2:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

它引导您访问的网站显示:

This error is reported in case the execution of a plugin failed due to some unforeseen event. For example, uncatched runtime exceptions caused by the plugin will raise this error. You should report this problem to the maintainer of the plugin.

现在,我很愿意相信我已经正确完成了所有操作,这确实是构建的问题。但是,在我向 API 创建者发送一封令人讨厌的电子邮件之前,我想确保错误不是由我造成的。

因此,问题是:如果您有一个 Netbeans Maven 项目,想要编译该项目以创建一个库类路径 .jar 以在另一个项目中使用,您会怎么做?我做得正确吗?

编辑:

使用 -e 构建项目会产生以下结果:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.2:test (default-test) on project ecwid-mailchimp: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.2:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.2:test (default-test) on project ecwid-mailchimp: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.2:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.2:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.RuntimeException: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.close(ForkClient.java:245)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:282)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:116)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:695)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAllProviders(AbstractSurefireMojo.java:666)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:624)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:587)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more

Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

苏......这是一件事。

最佳答案

如果你只想要 jar 并且不想关心测试执行(它死掉的地方),你可以调用

mvn clean install -DskipTests

跳过surefire插件的执行并获取jar

然后在您的项目中添加此 Artifact 作为依赖项(假设它是 Maven 项目)

<dependency>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
</dependency>

如果你想看看出了什么问题,我怀疑jvm崩溃最有可能与OutOfMemory有关,我会通过在MAVEN_OPTS中设置更高的堆空间来增加maven的内存,并增加surefire的插件jvm的堆(如果它是一个fork)

关于maven - 在 Netbeans 中从 Github 创建库 .jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24719115/

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