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

NullPointer when validating on pom-Dependencies with parent version in tagetplatform #537

Closed
EaseRider opened this issue Jan 13, 2022 · 4 comments · Fixed by #600
Closed
Milestone

Comments

@EaseRider
Copy link

EaseRider commented Jan 13, 2022

When testing Tycho 2.6.0-SNAPSHOT i ran onto a small error. The pom dependency has its version set by the parent. E.g.:

<parent>
    <groupId>my.bundles</groupId>
    <artifactId>my-bundles</artifactId>
    <version>1.2.3-SNAPSHOT</version>
  </parent>

  <artifactId>thirdparty-bundles</artifactId>
  <packaging>pom</packaging>

Either way this feature looks very good and usefull to us.

Workaround

Add fixed version in pom

  <artifactId>thirdparty-bundles</artifactId>
  <version>1.2.3-SNAPSHOT</version>
  <packaging>pom</packaging>

Stacktrace and some details

The MavenModelFacade model has a version null in org.eclipse.tycho.p2.resolver.FeatureGenerator#generatePomFeature
Maybe something needs to be done to propagate the version from its parent(s)

java.lang.NullPointerException
        at org.eclipse.tycho.p2.resolver.WrappedArtifact.createOSGiVersionFromMaven(WrappedArtifact.java:190)
        at org.eclipse.tycho.p2.resolver.FeatureGenerator.generatePomFeature(FeatureGenerator.java:150)
        at org.eclipse.tycho.p2.resolver.MavenTargetDefinitionContent.<init>(MavenTargetDefinitionContent.java:299)
        at org.eclipse.tycho.p2.target.TargetDefinitionResolver.resolveContentWithExceptions(TargetDefinitionResolver.java:184)
        at org.eclipse.tycho.p2.target.TargetDefinitionResolver.resolveContent(TargetDefinitionResolver.java:109)
        at org.eclipse.tycho.p2.target.TargetDefinitionResolverService.resolveFromArguments(TargetDefinitionResolverService.java:86)
        at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
        at org.eclipse.tycho.p2.target.TargetDefinitionResolverService.getTargetDefinitionContent(TargetDefinitionResolverService.java:59)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.resolveTargetDefinitions(TargetPlatformFactoryImpl.java:209)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:161)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:134)
        at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveMetadata(P2ResolverImpl.java:174)
        at org.eclipse.tycho.extras.tpvalidator.TPValidationMojo.validateTarget(TPValidationMojo.java:223)
        at org.eclipse.tycho.extras.tpvalidator.TPValidationMojo.execute(TPValidationMojo.java:152)
        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:972)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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:55)
@laeubi
Copy link
Member

laeubi commented Jan 13, 2022

can you share a small reproducer, best would be in the form of an integration-test.

@laeubi laeubi added this to the 2.7 milestone Jan 27, 2022
@laeubi
Copy link
Member

laeubi commented Jan 31, 2022

@EaseRider we are about to release 2.7 and I'd like to fix this there, do you think you can share additional details?

@laeubi
Copy link
Member

laeubi commented Jan 31, 2022

The pom dependency has its version set by the parent

I think you mean that the version is inherited from its parent pom reference? So in this case it should actually be 1.2.3-SNAPSHOT?

laeubi added a commit to laeubi/tycho that referenced this issue Jan 31, 2022
Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
@laeubi laeubi linked a pull request Jan 31, 2022 that will close this issue
laeubi added a commit that referenced this issue Jan 31, 2022
Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
@EaseRider
Copy link
Author

@laeubi
Sorry, for not responding. Yes exactly, the version is supposed to come from the parent. Or even parents parent. Thank you for looking into it.

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 a pull request may close this issue.

2 participants