Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build to use Tycho 4.0 #2748

Merged
merged 3 commits into from
Jul 7, 2023
Merged

Conversation

akurtakov
Copy link
Contributor

No description provided.

Bumps `tycho-version` from 3.0.5 to 4.0.0.

Updates `tycho-packaging-plugin` from 3.0.5 to 4.0.0
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-3.0.5...tycho-4.0.0)

Updates `tycho-p2-plugin` from 3.0.5 to 4.0.0
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-3.0.5...tycho-4.0.0)

Updates `target-platform-configuration` from 3.0.5 to 4.0.0
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-3.0.5...tycho-4.0.0)

Updates `tycho-maven-plugin` from 3.0.5 to 4.0.0
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-3.0.5...tycho-4.0.0)

Updates `tycho-source-plugin` from 3.0.5 to 4.0.0
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-3.0.5...tycho-4.0.0)

Updates `tycho-surefire-plugin` from 3.0.5 to 4.0.0

Updates `tycho-p2-repository-plugin` from 3.0.5 to 4.0.0
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-3.0.5...tycho-4.0.0)

Updates `tycho-p2-director-plugin` from 3.0.5 to 4.0.0
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-3.0.5...tycho-4.0.0)

---
updated-dependencies:
- dependency-name: org.eclipse.tycho:tycho-packaging-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.eclipse.tycho:tycho-p2-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.eclipse.tycho:target-platform-configuration
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.eclipse.tycho:tycho-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.eclipse.tycho:tycho-source-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.eclipse.tycho:tycho-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.eclipse.tycho:tycho-p2-repository-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.eclipse.tycho:tycho-p2-director-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@fbricon
Copy link
Contributor

fbricon commented Jul 6, 2023

please update https://github.com/eclipse/eclipse.jdt.ls/blob/master/.mvn/wrapper/maven-wrapper.properties as well

Can you give a meaningful PR title?

@akurtakov
Copy link
Contributor Author

This is continuation of #2740

@akurtakov akurtakov changed the title Pr 2740 Update build to use Tycho 4.0 Jul 6, 2023
Required by Tycho 4.0
@rgrunber
Copy link
Contributor

rgrunber commented Jul 6, 2023

Only annoying part is even for Fedora 38 Maven is on 3.8.x https://koji.fedoraproject.org/koji/packageinfo?packageID=11290 still so wrapper is the way to go now. Not sure why it still failed on the codeql verification build with the 3.9 version error.

@akurtakov
Copy link
Contributor Author

Maven in Fedora will likely never be updated again. I've moved to using Maven via sdkman. Actually I expect Maven to be dropped by Fedora.

@fbricon
Copy link
Contributor

fbricon commented Jul 6, 2023

I use zsh with the Maven plugin, so when I type a mvn command, it uses mvnw if found in the current directory, else falls back to whatever mvn is found in the PATH. it's awesome.

Screenshot 2023-07-06 at 16 22 44

@rgrunber
Copy link
Contributor

rgrunber commented Jul 7, 2023

The autobuild step, through mvn -N io.takari:maven:wrapper installs Maven 3.6.3, and the subsequent maven wrapper call uses that. One way around it is to just build manually. This worked for me :

patch
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index ee7ade6c..5872f6ed 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -44,10 +44,6 @@ jobs:
       with:
             java-version: '17'
             distribution: 'temurin'
-    - name: Set up Maven
-      uses: stCarolas/setup-maven@v4.5
-      with:
-        maven-version: 3.9.3
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
       uses: github/codeql-action/init@v2
@@ -63,8 +59,8 @@ jobs:
         
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # If this step fails, then you should remove it and run the build manually (see below)
-    - name: Autobuild
-      uses: github/codeql-action/autobuild@v2
+    # - name: Autobuild
+    #  uses: github/codeql-action/autobuild@v2
 
     # ℹ️ Command-line programs to run using the OS shell.
     # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -72,9 +68,8 @@ jobs:
     #   If the Autobuild fails above, remove it and uncomment the following three lines. 
     #   modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
 
-    # - run: |
-    #   echo "Run, Build Application using script"
-    #   ./location_of_script_within_repo/buildscript.sh
+    - name: Manual build
+      run: ./mvnw clean package -f "pom.xml" -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true -Dspotless.check.skip=true
 
     - name: Perform CodeQL Analysis
       uses: github/codeql-action/analyze@v2

Let me know if there's some way to bypass the wrapper re-generating. It's really strange that it would override existing wrapper of 3.9.3 with 3.6.3.

@akurtakov
Copy link
Contributor Author

It even overrides the Maven wrapper with the old takari one. I would move to your patch so we can finish here.

CodeQL autobuild uses old Takari Maven wrapper together bundled with old
Maven version which is not sufficient for Tycho requirements.
@akurtakov
Copy link
Contributor Author

@rgrunber I consider this one good to go.

Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and seems to be working as expected. I couldn't really find any documentation in codeql-action on how to configure the behaviour to avoid overriding the existing wrapper so we'll have to build manually for now. codeql analysis still seems to be present.

@rgrunber rgrunber merged commit 87d7d4a into eclipse-jdtls:master Jul 7, 2023
6 checks passed
@rgrunber rgrunber added this to the End July 2023 milestone Jul 7, 2023
@akurtakov akurtakov deleted the pr-2740 branch July 7, 2023 13:37
@testforstephen
Copy link
Contributor

After upgrading to tycho 4.0.0, I encountered an error when running the command mvnw -Pserver-distro clean package -Declipse.jdt.ls.skipGradleChecksums -e on Windows. Downgrading to tycho 3.0.5 works for me. I'm wondering if anyone else encounter similar issue?

[ERROR] bundle org.eclipse.equinox.p2.repository is not started
java.lang.IllegalStateException: bundle org.eclipse.equinox.p2.repository is not started
    at org.eclipse.equinox.internal.p2.repository.Activator.getContext (Activator.java:65)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.restoreFromSystemProperty (AbstractRepositoryManager.java:1013)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.restoreRepositories (AbstractRepositoryManager.java:1033)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.basicGetRepository (AbstractRepositoryManager.java:182)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository (AbstractRepositoryManager.java:666)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository (MetadataRepositoryManager.java:110)
    at org.eclipse.tycho.p2maven.transport.RemoteMetadataRepositoryManager.loadRepository (RemoteMetadataRepositoryManager.java:68)
    at org.eclipse.tycho.p2maven.transport.RemoteMetadataRepositoryManager.loadRepository (RemoteMetadataRepositoryManager.java:59)
    at org.eclipse.tycho.p2.resolver.URITargetDefinitionContent.preload (URITargetDefinitionContent.java:76)
    at org.eclipse.tycho.p2.resolver.URITargetDefinitionContent.query (URITargetDefinitionContent.java:53)
    at org.eclipse.equinox.p2.query.CompoundQueryable.getIteratorFromQueryable (CompoundQueryable.java:178)
    at org.eclipse.equinox.p2.query.CompoundQueryable.everything (CompoundQueryable.java:124)
    at org.eclipse.equinox.internal.p2.metadata.expression.RepeatableIterator$IndexProviderIterator.<init> (RepeatableIterator.java:142)
    at org.eclipse.equinox.internal.p2.metadata.expression.RepeatableIterator.create (RepeatableIterator.java:60)
    at org.eclipse.equinox.internal.p2.metadata.expression.Everything.<init> (Everything.java:39)
    at org.eclipse.equinox.internal.p2.metadata.expression.ContextExpression.createContext (ContextExpression.java:48)
    at org.eclipse.equinox.p2.query.ExpressionQuery.perform (ExpressionQuery.java:51)
    at org.eclipse.equinox.internal.p2.metadata.index.IndexProvider.query (IndexProvider.java:26)
    at org.eclipse.equinox.internal.p2.metadata.index.IndexProvider.query (IndexProvider.java:36)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.findUnit (InstallableUnitResolver.java:281)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.findUnits (InstallableUnitResolver.java:261)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.getRootIUs (InstallableUnitResolver.java:254)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.addLocation (InstallableUnitResolver.java:88)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContentWithExceptions (TargetDefinitionResolver.java:144)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContent (TargetDefinitionResolver.java:102)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.resolveFromArguments (TargetDefinitionResolverService.java:93)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1708)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.getTargetDefinitionContent (TargetDefinitionResolverService.java:68)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.resolveTargetDefinitions (TargetPlatformFactoryImpl.java:214)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:164)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:137)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:88)
    at org.eclipse.tycho.p2resolver.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform (ReactorRepositoryManagerImpl.java:71)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.computePreliminaryTargetPlatform (P2DependencyResolver.java:205)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:101)
    at org.eclipse.tycho.core.maven.TychoProjectExecutionListener.beforeProjectLifecycleExecution (TychoProjectExecutionListener.java:108)
    at org.apache.maven.lifecycle.internal.CompoundProjectExecutionListener.beforeProjectLifecycleExecution (CompoundProjectExecutionListener.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:103)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

@akurtakov
Copy link
Contributor Author

I can't test on Windows but the very same command worked for me on Linux without problem.

@rgrunber
Copy link
Contributor

Similar to eclipse-tycho/tycho#2042 ?

@datho7561
Copy link
Contributor

datho7561 commented Jul 10, 2023

Here's what I get on Windows, using PowerShell:

[ERROR] Unknown lifecycle phase ".jdt.ls.skipGradleChecksums". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.LifecyclePhaseNotFoundException: Unknown lifecycle phase ".jdt.ls.skipGradleChecksums". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy.
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:225)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:197)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:119)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:135)
    at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:93)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:100)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:52)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:161)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:73)

on Command Prompt, it works properly.

@datho7561
Copy link
Contributor

datho7561 commented Jul 10, 2023

One aspect that I changed is that I ran mvn.bat -Pserver-distro clean package -Declipse.jdt.ls.skipGradleChecksums -e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants