Skip to content
Advertisement

Could not find maven-metadata.xml in local during release

I have a local Eclipse RCP project on my Windows machine. One of my remote repositories is used for development and the other for staging during release. The tools used during build and release are Maven, Git, SSH and GitHub.

I can build and run tests without any issues:

mvn clean verify

but when I perform a release prepare:

mvn -X --batch-mode --log-file ./log.txt -Dusername=myUserName release:prepare

I end up with following error:

[INFO] [DEBUG] Could not find metadata vcs:target-platform:0.0.1-SNAPSHOT/maven-metadata.xml in local (C:Userspew.m2repository)
[INFO] [ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact vcs:target-platform:target:0.0.1-SNAPSHOT -> [Help 1]

I can authenticate to GitHub thru SSH from CLI.

As far as I understand the maven-metadata.xml file shall be generated when the artifacts are published …or am I wrong? I can’t find that file anywhere on my machine after a release prepare. Is there a problem with SNAPSHOT versions in the Eclipse project? I think those versions shall be automatically transformed to fixed versions by the Maven Release Plugin when the release is generated?

Since I’m new to this I probably have missed some necessary setups I guess.

I would appreciate any guidance very much.

Here is my pom.xml:

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>vcs</groupId>
<artifactId>vcs.root</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<properties>
    <tycho.version>2.3.0</tycho.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<scm>
    <developerConnection>scm:git:ssh://github.com/myUserName/vcs.git</developerConnection>
    <tag>vcs.root-0.0.1</tag>
</scm>
<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-p2-director-plugin</artifactId>
                <version>${tycho.version}</version>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>${tycho.version}</version>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-toolchains-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>toolchain</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <toolchains>
                    <jdk>
                        <version>11.0.13</version>
                        <vendor>Eclipse Adoptium</vendor>
                    </jdk>
                    <jdk>
                        <version>15.0.2</version>
                        <vendor>Eclipse Adoptium</vendor>
                    </jdk>
                    <jdk>
                        <version>16.0.2</version>
                        <vendor>Eclipse Adoptium</vendor>
                    </jdk>
                </toolchains>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho.version}</version>
            <configuration>
                <executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-15</executionEnvironment>
                <target>
                    <artifact>
                        <groupId>vcs</groupId>
                        <artifactId>target-platform</artifactId>
                        <version>0.0.1-SNAPSHOT</version>
                    </artifact>
                </target>
                <environments>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86_64</arch>
                    </environment>
                </environments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <stagingRepository>https://github.com/myUserName/vcs_stage.git</stagingRepository>
            </configuration>
        </plugin>
    </plugins>
</build>
<modules>
    <module>bundles</module>
    <module>features</module>
    <module>releng</module>
    <module>tests</module>
</modules>

..and here is the first and the last part of the log file (too big to include all):

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:Program Files (x86)Apacheapache-maven-3.8.1
Java version: 15.0.2, vendor: Oracle Corporation, runtime: C:Program FilesJavajdk-15.0.2
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
[DEBUG] Reading global settings from C:Program Files (x86)Apacheapache-maven-3.8.1confsettings.xml
[DEBUG] Reading user settings from C:Userspew.m2settings.xml
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:Userspew.m2repository
.
.
.
[INFO] [DEBUG] target-platform-configuration for MavenProject: vcs:info.wallberg.library.fileextractor.plugin:1.0.0-SNAPSHOT @ C:Userspewworkgitvcsbundlesinfo.wallberg.library.fileextractor.plugin.polyglot.META-INF:
[INFO] <?xml version="1.0" encoding="UTF-8"?>
[INFO] <configuration>
[INFO]   <executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-15</executionEnvironment>
[INFO]   <target>
[INFO]     <artifact>
[INFO]       <groupId>vcs</groupId>
[INFO]       <artifactId>target-platform</artifactId>
[INFO]       <version>0.0.1-SNAPSHOT</version>
[INFO]     </artifact>
[INFO]   </target>
[INFO]   <environments>
[INFO]     <environment>
[INFO]       <os>win32</os>
[INFO]       <ws>win32</ws>
[INFO]       <arch>x86_64</arch>
[INFO]     </environment>
[INFO]   </environments>
[INFO] </configuration>
[INFO] [DEBUG] Could not find metadata vcs:target-platform:0.0.1-SNAPSHOT/maven-metadata.xml in local (C:Userspew.m2repository)
[INFO] [ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact vcs:target-platform:target:0.0.1-SNAPSHOT -> [Help 1]
[INFO] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact vcs:target-platform:target:0.0.1-SNAPSHOT
[INFO]     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
[INFO]     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
[INFO]     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
[INFO]     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
[INFO]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
[INFO]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
[INFO]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
[INFO]     at java.lang.reflect.Method.invoke (Method.java:564)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] Caused by: java.lang.RuntimeException: Could not resolve target platform specification artifact vcs:target-platform:target:0.0.1-SNAPSHOT
[INFO]     at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.addTargetArtifact (DefaultTargetPlatformConfigurationReader.java:445)
[INFO]     at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.setTarget (DefaultTargetPlatformConfigurationReader.java:371)
[INFO]     at org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader.getTargetPlatformConfiguration (DefaultTargetPlatformConfigurationReader.java:98)
[INFO]     at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject (DefaultTychoResolver.java:97)
[INFO]     at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:99)
[INFO]     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
[INFO]     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
[INFO]     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
[INFO]     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
[INFO]     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
[INFO]     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
[INFO]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
[INFO]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
[INFO]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
[INFO]     at java.lang.reflect.Method.invoke (Method.java:564)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
[INFO]     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] [ERROR] 
[INFO] [ERROR] 
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] vcs.root 0.0.1-SNAPSHOT ............................ FAILURE [  3.514 s]
[INFO] [aggregator] bundles 0.0.1-SNAPSHOT ................ SKIPPED
.
.
.
[INFO] [aggregator] features 0.0.1-SNAPSHOT ............... SKIPPED
.
.
.
[INFO] [aggregator] releng 0.0.1-SNAPSHOT ................. SKIPPED
[INFO] [product] ... 0.0.1 ............................ SKIPPED
[INFO] [target] target-platform 0.0.1-SNAPSHOT ............ SKIPPED
[INFO] [aggregator] tests 0.0.1-SNAPSHOT .................. SKIPPED
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.532 s
[INFO] Finished at: 2022-03-19T16:52:48+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M5:prepare (default-cli) on project vcs.root: Maven execution failed, exit code: '1' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M5:prepare (default-cli) on project vcs.root: Maven execution failed, exit code: '1'
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1'
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease (PrepareReleaseMojo.java:394)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.execute (PrepareReleaseMojo.java:327)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
    at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute (AbstractRunGoalsPhase.java:90)
    at org.apache.maven.shared.release.phase.RunPrepareGoalsPhase.execute (RunPrepareGoalsPhase.java:46)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare (DefaultReleaseManager.java:205)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare (DefaultReleaseManager.java:101)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease (PrepareReleaseMojo.java:390)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.execute (PrepareReleaseMojo.java:327)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
    at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals (InvokerMavenExecutor.java:404)
    at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals (AbstractMavenExecutor.java:93)
    at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute (AbstractRunGoalsPhase.java:83)
    at org.apache.maven.shared.release.phase.RunPrepareGoalsPhase.execute (RunPrepareGoalsPhase.java:46)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare (DefaultReleaseManager.java:205)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare (DefaultReleaseManager.java:101)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease (PrepareReleaseMojo.java:390)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.execute (PrepareReleaseMojo.java:327)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[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/MojoExecutionException

Advertisement

Answer

Embarrassing enough, the reason why it didn’t worked out was that I had forgotten to update JAVA_HOME path to an existing Java platform.

Advertisement