microsoft / java-debug

The debug server implementation for Java. It conforms to the debug protocol of Visual Studio Code (DAP, Debugger Adapter Protocol).
Other
335 stars 154 forks source link

Install fails #539

Open paulkre opened 8 months ago

paulkre commented 8 months ago

I'm getting the following error when running ./mvnw clean install -e (version 0.51.1):

Failed to resolve target definition file:/home/paul/opt/java-debug/com.microsoft.java.debug.target/com.microsoft.java.debug.tp.target: Failed to load p2 metadata repository from location https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240130-1800/: No repository found at https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240130-1800.
org.eclipse.tycho.BuildFailureException: Failed to resolve target definition file:/home/paul/opt/java-debug/com.microsoft.java.debug.target/com.microsoft.java.debug.tp.target: Failed to load p2 metadata repository from location https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240130-1800/
...
Caused by: org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException: Failed to load p2 metadata repository from location https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240130-1800/
...
Caused by: org.eclipse.equinox.p2.core.ProvisionException: No repository found at https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240130-1800.
Libadoxon commented 8 months ago

duplicate of 537 and was fixed in the latest commit. I suggest building from the latest commit.

manuel-uberti commented 8 months ago

Not sure if the latest commit is working as expected. I cloned the repository, from the main branch I ran ./mvnw clean install -e and I see the following:

[ERROR] Failed to resolve target definition file:/home/manuel/code/java-debug/com.microsoft.java.debug.target/com.microsoft.java.debug.tp.target: See log for details
org.eclipse.tycho.BuildFailureException: Failed to resolve target definition file:/home/manuel/code/java-debug/com.microsoft.java.debug.target/com.microsoft.java.debug.tp.target
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContent (TargetDefinitionResolver.java:125)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.resolveFromArguments (TargetDefinitionResolverService.java:96)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1708)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.getTargetDefinitionContent (TargetDefinitionResolverService.java:70)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.resolveTargetDefinitions (TargetPlatformFactoryImpl.java:366)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:219)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:185)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:123)
    at org.eclipse.tycho.p2resolver.DefaultTargetPlatformFactory.createTargetPlatform (DefaultTargetPlatformFactory.java:75)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.lambda$getPreliminaryTargetPlatform$3 (P2DependencyResolver.java:242)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject$LazyValue.get (DefaultReactorProject.java:307)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject.computeContextValue (DefaultReactorProject.java:200)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.getPreliminaryTargetPlatform (P2DependencyResolver.java:209)
    at org.eclipse.tycho.core.osgitools.AbstractTychoProject.lambda$getDependencyArtifacts$0 (AbstractTychoProject.java:83)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject$LazyValue.get (DefaultReactorProject.java:307)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject.computeContextValue (DefaultReactorProject.java:200)
    at org.eclipse.tycho.core.osgitools.AbstractTychoProject.getDependencyArtifacts (AbstractTychoProject.java:77)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:98)
    at org.eclipse.tycho.core.maven.TychoProjectExecutionListener.beforeProjectLifecycleExecution (TychoProjectExecutionListener.java:111)
    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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
    at java.lang.reflect.Method.invoke (Method.java:578)
    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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
    at java.lang.reflect.Method.invoke (Method.java:578)
    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:60)
Caused by: org.eclipse.tycho.p2.resolver.ResolverException: See log for details
    at org.eclipse.tycho.p2resolver.ProjectorResolutionStrategy.resolve (ProjectorResolutionStrategy.java:119)
    at org.eclipse.tycho.p2resolver.AbstractResolutionStrategy.multiPlatformResolve (AbstractResolutionStrategy.java:62)
    at org.eclipse.tycho.p2resolver.InstallableUnitResolver.resolve (InstallableUnitResolver.java:136)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContentWithExceptions (TargetDefinitionResolver.java:285)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContent (TargetDefinitionResolver.java:116)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.resolveFromArguments (TargetDefinitionResolverService.java:96)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1708)
    at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.getTargetDefinitionContent (TargetDefinitionResolverService.java:70)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.resolveTargetDefinitions (TargetPlatformFactoryImpl.java:366)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:219)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:185)
    at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:123)
    at org.eclipse.tycho.p2resolver.DefaultTargetPlatformFactory.createTargetPlatform (DefaultTargetPlatformFactory.java:75)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.lambda$getPreliminaryTargetPlatform$3 (P2DependencyResolver.java:242)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject$LazyValue.get (DefaultReactorProject.java:307)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject.computeContextValue (DefaultReactorProject.java:200)
    at org.eclipse.tycho.p2resolver.P2DependencyResolver.getPreliminaryTargetPlatform (P2DependencyResolver.java:209)
    at org.eclipse.tycho.core.osgitools.AbstractTychoProject.lambda$getDependencyArtifacts$0 (AbstractTychoProject.java:83)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject$LazyValue.get (DefaultReactorProject.java:307)
    at org.eclipse.tycho.core.osgitools.DefaultReactorProject.computeContextValue (DefaultReactorProject.java:200)
    at org.eclipse.tycho.core.osgitools.AbstractTychoProject.getDependencyArtifacts (AbstractTychoProject.java:77)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:98)
    at org.eclipse.tycho.core.maven.TychoProjectExecutionListener.beforeProjectLifecycleExecution (TychoProjectExecutionListener.java:111)
    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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
    at java.lang.reflect.Method.invoke (Method.java:578)
    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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
    at java.lang.reflect.Method.invoke (Method.java:578)
    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:60)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Libadoxon commented 8 months ago

I noticed that too after writing the comment, check out issue 540 for tracking of the problem

gromms commented 8 months ago

I'm also facing a similar issue:

[ERROR] Failed to resolve target definition file:/Users/grom/.local/share/nvim/java-debug/com.microsoft.java.debug.target/com.microsoft.java.debug.tp.target: 
Failed to load p2 metadata repository from location https://download.eclipse.org/eclipse/updates/4.31/: 
Unable to read repository at https://download.eclipse.org/eclipse/updates/4.31. No repository found at https://download.eclipse.org/eclipse/updates/4.31/R-4.31-202402290520.
jdneo commented 8 months ago

Please add -U to force update.

See: https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/3103

gromms commented 8 months ago

Please add -U to force update.

See: eclipse-jdtls/eclipse.jdt.ls#3103

That did the trick. Thank you!

LuciusChen commented 2 months ago

Please add -U to force update.

See: eclipse-jdtls/eclipse.jdt.ls#3103

not work for me

[INFO] Building Java Debug Server for Visual Studio Code :: Debugger Plugin 0.53.0 [3/5]
[INFO]   from com.microsoft.java.debug.plugin/pom.xml
[INFO] ---------------------------[ eclipse-plugin ]---------------------------
[WARNING] Parameter 'resolver' is unknown for plugin 'target-platform-configuration:4.0.6:target-platform (default-target-platform)'
[WARNING] Using JavaSE-22 to fulfill requested profile of JavaSE-11. This might lead to faulty dependency resolution, consider defining a suitable JDK in the toolchains.xml.
[INFO] Resolving target definition file:/Users/luciuschen/.emacs.d/debug-adapters/java-debug/com.microsoft.java.debug.target/com.microsoft.java.debug.tp.target for environments=[macosx/cocoa/aarch64], include source mode=honor, referenced repository mode =ignore, execution environment=StandardEEResolutionHints [executionEnvironment=OSGi profile 'JavaSE-22' { source level: 22, target level: 22}], remote p2 repository options=org.eclipse.tycho.p2maven.DefaultProvisioningAgent@55a6cc36
[INFO] ### Using TychoRepositoryTransport for remote P2 access ###
[INFO]     Cache location:         /Users/luciuschen/.m2/repository/.cache/tycho
[INFO]     Transport mode:         online
[INFO]     Http Transport type:    Java11Client
[INFO]     Update mode:            forced
[INFO]     Minimum cache duration: 60 minutes
[INFO]       (you can configure this with -Dtycho.p2.transport.min-cache-minutes=<desired minimum cache duration>)
[INFO] Downloading from p2: https://download.eclipse.org/tools/orbit/R-builds/R20170516192513/repository/p2.index
[INFO] Downloaded from p2: https://download.eclipse.org/tools/orbit/R-builds/R20170516192513/repository/p2.index (134 bytes at 0 bytes/s)
[INFO] Downloading from p2: https://download.eclipse.org/tools/orbit/downloads/drops/R20170303204511/repository/p2.index
[INFO] Downloading from p2: https://download.eclipse.org/tools/orbit/downloads/drops2/R20170516192513/repository/p2.index
[INFO] Downloaded from p2: https://download.eclipse.org/tools/orbit/downloads/drops2/R20170516192513/repository/p2.index (172 bytes at 0 bytes/s)
[INFO] Downloading from p2: https://download.eclipse.org/eclipse/updates/4.33-I-builds/I20240613-1800/p2.index
[INFO] Downloading from p2: https://download.eclipse.org/eclipse/updates/4.33-I-builds/I20240613-1800/site.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Java Debug Server for Visual Studio Code :: Parent 0.53.0:
[INFO] 
[INFO] Java Debug Server for Visual Studio Code :: Parent . SUCCESS [  0.038 s]
[INFO] Java Debug Server for Visual Studio Code :: Debugger Core SUCCESS [  2.887 s]
[INFO] Java Debug Server for Visual Studio Code :: Debugger Plugin FAILURE [  5.686 s]
[INFO] Java Debug Server for Visual Studio Code :: P2 Update site SKIPPED
[INFO] Java Debug Server for Visual Studio Code :: Target Platform SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.324 s
[INFO] Finished at: 2024-09-16T21:54:49+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to resolve target definition file:/Users/luciuschen/.emacs.d/debug-adapters/java-debug/com.microsoft.java.debug.target/com.microsoft.java.debug.tp.target: Failed to load p2 metadata repository from location https://download.eclipse.org/eclipse/updates/4.33-I-builds/I20240613-1800: No repository found at https://download.eclipse.org/eclipse/updates/4.33-I-builds/I20240613-1800.
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
java-debug  🍣 main via ☕ v22.0.1  took 11s

https://github.com/microsoft/java-debug/issues/569 work for me