如何向Maven Central发布Xtext 2.13项目
我已经创建了一种Xtext语言,我想将其发布到Maven central。我已经准备了以下版本:如何向Maven Central发布Xtext 2.13项目,maven,xtext,tycho,Maven,Xtext,Tycho,我已经创建了一种Xtext语言,我想将其发布到Maven central。我已经准备了以下版本: mvn release:prepare 我第一次尝试用 mvn release:perform 由于严格的Javadoc检查而失败(Xtext生成一些Javadoc插件无法理解的标记)。因此,我将其添加到我的插件管理部分,以消除错误并将其转换为警告: <plugin> <groupId>org.apache.maven.plugins</groupId&g
mvn release:prepare
我第一次尝试用
mvn release:perform
由于严格的Javadoc检查而失败(Xtext生成一些Javadoc插件无法理解的标记)。因此,我将其添加到我的插件管理
部分,以消除错误并将其转换为警告:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
这一错误的原因可能是什么?如果有必要,它会在Javadoc警告之后立即发生
编辑:在手动执行Maven日志中的步骤后,我得到了完整的堆栈跟踪:
[INFO] [ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-
plugin:1.1.0-SNAPSHOT:p2-metadata (attach-p2-metadata) on project com.hribol.bromium.dsl: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.: IllegalArgumentException -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata (attach-p2-metadata) on project com.hribol.bromium.dsl: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Caused by: org.apache.maven.plugin.PluginExecutionException: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[INFO] ... 20 more
[INFO] Caused by: java.lang.IllegalArgumentException
[INFO] at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.getCanonicalArtifact(P2GeneratorImpl.java:193)
[INFO] at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.generateMetadata(P2GeneratorImpl.java:146)
[INFO] at org.eclipse.tycho.plugins.p2.P2MetadataMojo.attachP2Metadata(P2MetadataMojo.java:149)
[INFO] at org.eclipse.tycho.plugins.p2.P2MetadataMojo.execute(P2MetadataMojo.java:108)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[INFO] ... 21 more
编辑2:遵循解决方案后,从-仅将tycho p2插件移动到需要它的项目-功能、存储库和目标,构建不再因
IllegalArgumentException
而中断。这次它在签名阶段失败,因为缺少名为p2content.xml
的文件。有人知道原因是什么吗?如果我只是用mvn clean install
构建项目,p2content.xml
确实被创建了,所以我认为这可能是由于一些错误的执行顺序。可能应该在调试模式下运行maven,以获得更好的错误消息发布插件在maven内部运行maven,因为它使用了存储库中的标记,因此,我无法控制构建它时使用的选项,我想您是否遵循了最初的提示我没有,但即使我现在这样做了,我仍然会得到相同的异常。我想对于edit#2,详细的错误消息也会非常有用
[INFO] [ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-
plugin:1.1.0-SNAPSHOT:p2-metadata (attach-p2-metadata) on project com.hribol.bromium.dsl: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.: IllegalArgumentException -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata (attach-p2-metadata) on project com.hribol.bromium.dsl: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Caused by: org.apache.maven.plugin.PluginExecutionException: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[INFO] ... 20 more
[INFO] Caused by: java.lang.IllegalArgumentException
[INFO] at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.getCanonicalArtifact(P2GeneratorImpl.java:193)
[INFO] at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.generateMetadata(P2GeneratorImpl.java:146)
[INFO] at org.eclipse.tycho.plugins.p2.P2MetadataMojo.attachP2Metadata(P2MetadataMojo.java:149)
[INFO] at org.eclipse.tycho.plugins.p2.P2MetadataMojo.execute(P2MetadataMojo.java:108)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[INFO] ... 21 more