Hari
Hari

Reputation: 1

Tycho Update from 2.7.5 to 4.0.5 causing p2.index Getting Redownload Causes Artifact Resolution Failure - bundleLocation null

I’m facing an issue during my Maven build process when using Tycho for Eclipse plugin development. Specifically, the problem occurs when the p2.index file gets redownloaded while the Maven build is in progress. This causes my Eclipse plugin artifact to not be resolved correctly, even though the latest artifact is available in the repository.

I'm facing issue after migrating tycho from 2.7.5 to 4.0.5.

I’m using Jfrog Artifactory as the repository manager. In my parent pom.xml, I’ve configured the repositories using the p2 layout. Initially, the plugin artifact is downloaded from the repository as a snapshot version with an old timestamp. At some point during the build, the p2.index is redownloaded (due to some other reason), and it gets updated with the latest artifact versions. However, the updated p2.index does not trigger the download of the latest plugin JAR, and the artifact is not resolved correctly.

We have configured the build to fail at end -fae option to execute all builds.

The p2 index is getting re-downloaded at 2 cases

  1. When a build fails due to a surefire.timeout, the p2 index is redownloaded. This happens after the com.my.comp.sw.editor.ar4x.junit.tests build fails, and the index is updated during the com.my.comp.sw.editor.ar4x.wt2.tests build(Second build after timeout build).

    For example:

    17:55:30  [INFO] com.my.comp.sw.diffmerge.editor.test 1.0.0-SNAPSHOT SUCCESS [24:03 min]
    17:55:30  [INFO] com.my.comp.sw.editor.ar4x.junit.tests 1.0.0-SNAPSHOT FAILURE [  02:31 h]
    17:55:30  [INFO] com.my.comp.sw.editor.ar4x.wt1.tests 1.0.0-SNAPSHOT SUCCESS [40:02 min]
    17:55:30  [INFO] com.my.comp.sw.editor.ar4x.wt2.tests 1.0.0-SNAPSHOT SUCCESS [15:46 min]
    
  2. If a build takes longer than one hour, the p2 index is redownloaded again in "com.my.comp.generic.editor.ar4x.wt.tests", even if the build is successful

    For example:

    17:55:30  [INFO] com.my.comp.sw.editor.ar4x.wt6.tests 1.0.0-SNAPSHOT SUCCESS [  01:14 h]
    17:55:30  [INFO] com.my.comp.generic.editor.ar4x.wt.tests 1.0.0-SNAPSHOT SUCCESS [20:08 min]
    

p2 download attempt:

[2025-02-20T22:58:27.297Z] [INFO] --< com.my.components:com.my.comp.sw.editor.ar4x.wt2.tests >--
[2025-02-20T22:58:27.297Z] [INFO] Building com.my.comp.sw.editor.ar4x.wt2.tests 1.0.0-SNAPSHOT [78/125]
[2025-02-20T22:58:27.297Z] [INFO]   from D:\Slave\Jenkins\workspace\ecl_comp_editors-MAIN-Compile-Test_4.33_Hari\comp_editors\com.my.comp.sw.editor.ar4x.wt2.tests\pom.xml
[2025-02-20T22:58:27.297Z] [INFO] ------------------------[ eclipse-test-plugin ]-------------------------
[2025-02-20T22:58:27.297Z] [WARNING] Parameter 'skip' is unknown for plugin 'tycho-p2-plugin:4.0.5:p2-metadata (attached-p2-metadata)'
[2025-02-20T22:58:27.297Z] [WARNING] Parameter 'strictBinIncludes' is unknown for plugin 'tycho-p2-plugin:4.0.5:p2-metadata (attached-p2-metadata)'
[2025-02-20T22:58:27.297Z] [WARNING] Parameter 'surefire.timeout' is unknown for plugin 'tycho-surefire-plugin:4.0.5:test (WTExecution)'
[2025-02-20T22:58:27.297Z] [WARNING] Parameter 'surefire.timeout' is unknown for plugin 'tycho-surefire-plugin:4.0.5:test (SWTBotExecution)'
[2025-02-20T22:58:27.297Z] [INFO] Downloading from p2: ``https://artifactory.com/artifactory/arc_tool_devops-p2-snapshot-virtual/com/my/components/ecl_comp_empulsar/4.33.0-SNAPSHOT/ecl_comp_empulsar-4.33.0-SNAPSHOT.zip!/p2.index 
[2025-02-20T22:58:27.297Z] [INFO] Downloaded from p2: ``https://artifactory.com/artifactory/arc_tool_devops-p2-snapshot-virtual/com/my/components/ecl_comp_empulsar/4.33.0-SNAPSHOT/ecl_comp_empulsar-4.33.0-SNAPSHOT.zip!/p2.index`` (172 bytes at 33 KB/s)
[2025-02-20T22:58:27.297Z] [INFO] Adding repository ``https://artifactory.com/artifactory/arc_tool_devops-p2-snapshot-virtual/com/my/components/ecl_comp_empulsar/4.33.0-SNAPSHOT/ecl_comp_empulsar-4.33.0-SNAPSHOT.zip

Error message:

19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.sw.validation4x.quickfixes.test: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]
19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.sw.editor.propertyview.wt.tests: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]
19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.sw.generator.core4x.junit.test: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]
19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.sw.importer.core.wt.tests: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]
19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.sw.editor.ar4x.postbuild.wt.tests: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]
19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.sw.postbuild.ui.test: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]
19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.os.editor.swtbot.tests: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]
19:45:37  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath (default-validate-classpath) on project com.my.comp.sw.editor.ar4x.customfill.junit.tests: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.11:validate-classpath failed: bundleLocation can't be null for artifact eclipse-plugin:org.apache.xmlbeans:2.6.0.202502211234: null -> [Help 2]

Expected behavior:

I would like the plugin artifact to be resolved properly during the build process, even if the p2.index gets redownloaded or updated in between the build. Ideally, I want to avoid the issue where the artifact is not downloaded due to mismatched or outdated indices.

Questions:

Attempts to resolve:

I’ve tried the following solutions one by one, but the p2.index continues to get downloaded multiple times:

-Dtycho.p2.transport.min-cache-minutes=1800 -Dtycho.p2.transport=ecf

However, none of these resolved the issue.

P2 initial INFO message before trying attempts:

[2025-02-20T20:10:43.756Z] [INFO] ### Using TychoRepositoryTransport for remote P2 access ###
[2025-02-20T20:10:43.756Z] [INFO]     Cache location:         D:\workspace\Maven_repo_pipeline_test_433.cache\tycho
[2025-02-20T20:10:43.756Z] [INFO]     Transport mode:         online
[2025-02-20T20:10:43.756Z] [INFO]     Http Transport type:    Java11Client
[2025-02-20T20:10:43.756Z] [INFO]     Update mode:            forced
[2025-02-20T20:10:43.756Z] [INFO]     Minimum cache duration: 60 minutes

Upvotes: 0

Views: 40

Answers (0)

Related Questions