[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17069815#comment-17069815 ] Hudson commented on MNG-6495: - Build failed in Jenkins: Maven TLP » maven-studies » maven-metrics #4 See https://builds.apache.org/job/maven-box/job/maven-studies/job/maven-metrics/4/ > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Assignee: Michael Osipov >Priority: Major > Fix For: 3.6.1 > > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16810384#comment-16810384 ] Hudson commented on MNG-6495: - Build unstable in Jenkins: Maven TLP » maven » MNG-6169/MNG-6556 #12 See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6556/12/ > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Assignee: Michael Osipov >Priority: Major > Fix For: 3.6.1 > > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16782707#comment-16782707 ] Hudson commented on MNG-6495: - Build succeeded in Jenkins: Maven TLP » maven » MNG-6294 #12 See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6294/12/ > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Assignee: Michael Osipov >Priority: Major > Fix For: 3.6.1 > > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16770673#comment-16770673 ] Hudson commented on MNG-6495: - Build succeeded in Jenkins: Maven TLP » maven » MNG-6169/MNG-6550 #8 See https://builds.apache.org/job/maven-box/job/maven/job/MNG-6169%252FMNG-6550/8/ > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Assignee: Michael Osipov >Priority: Major > Fix For: 3.6.1 > > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16770432#comment-16770432 ] Hudson commented on MNG-6495: - Build unstable in Jenkins: Maven TLP » maven » master #173 See https://builds.apache.org/job/maven-box/job/maven/job/master/173/ > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Assignee: Michael Osipov >Priority: Major > Fix For: 3.6.1 > > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16770192#comment-16770192 ] Michael Osipov commented on MNG-6495: - I will simply update the Javadoc content. > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Assignee: Michael Osipov >Priority: Major > Fix For: 3.6.1 > > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16684287#comment-16684287 ] Sylwester Lachiewicz commented on MNG-6495: --- Looks like we need to update doc here: [ModelBuildingRequest:298|https://gitbox.apache.org/repos/asf?p=maven.git;a=blob;f=maven-model-builder/src/main/java/org/apache/maven/model/building/ModelBuildingRequest.java;h=bc6e71bee21c2c97538a89bad931dc34ad1574cc;hb=HEAD#l298] ? > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Priority: Major > Fix For: 3.6.x-candidate > > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16668887#comment-16668887 ] Elliotte Rusty Harold commented on MNG-6495: I think this is the code where I stumbled onto this. Looks like I since added a ModelResolver to avoid the issue, but try setting that to null instead and see what happens. package com.google.cloud.tools.opensource.dependencies; import java.net.MalformedURLException; import java.net.URL; import org.apache.maven.building.UrlSource; import org.apache.maven.model.Model; import org.apache.maven.model.building.DefaultModelBuilder; import org.apache.maven.model.building.DefaultModelBuilderFactory; import org.apache.maven.model.building.DefaultModelBuildingRequest; import org.apache.maven.model.building.ModelBuildingException; import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.model.building.ModelBuildingResult; import org.apache.maven.model.building.ModelSource; import org.apache.maven.model.building.UrlModelSource; import org.apache.maven.model.resolution.ModelResolver; import org.apache.maven.model.resolution.UnresolvableModelException; import org.apache.maven.project.ProjectModelResolver; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.resolution.DependencyResolutionException; public class MetadataExplorer { public static void main(String[] args) throws DependencyCollectionException, DependencyResolutionException, MalformedURLException, UnresolvableModelException { try { DefaultArtifact artifact = new DefaultArtifact("com.google.guava:guava:26.0-jre"); DefaultModelBuilder modelBuilder = new DefaultModelBuilderFactory().newInstance(); ModelBuildingRequest request = new DefaultModelBuildingRequest(); URL pomUrl = new URL( "https://repo1.maven.org/maven2/com/google/guava/guava/26.0-jre/guava-26.0-jre.pom;); UrlModelSource source = new UrlModelSource(pomUrl); request.setModelSource(source); ProjectModelResolver modelResolver = new ProjectModelResolver(null, null, null, null, null, null, null); ModelSource s = modelResolver.resolveModel("com.google.guava", "guava", "26.0-jre"); request.setModelResolver(modelResolver); ModelBuildingResult result = modelBuilder.build(request); Model model = result.getEffectiveModel(); System.out.println(model.getArtifactId()); } catch (IllegalArgumentException ex) { System.err.println("Bad Maven coordinates " + args[0]); return; } catch (ModelBuildingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Priority: Major > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16661094#comment-16661094 ] Elliotte Rusty Harold commented on MNG-6495: I'll have to see if I can repro this. This as not a command line invocation of Maven. It happened because some of my own code attempted to pass null for an argument. > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Priority: Major > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16661080#comment-16661080 ] Robert Scholte commented on MNG-6495: - I don't understand the {{[unknown-version]}}-part. As if the parent-pom is invalid. Do you have a minimal pom to reproduce this issue? > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Priority: Major > > Got this exception stacktrace while writing some of my own code today: > {noformat} > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > {noformat} > No big deal except that the JavaDoc at > [ModelBuildingRequest|http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html] > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MNG-6495) ModelResolver cannot be null
[ https://issues.apache.org/jira/browse/MNG-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16652162#comment-16652162 ] Michael Osipov commented on MNG-6495: - Ouch...[~rfscholte], this an easy fix if we know which source is correct: Javadoc or source code. Ideas? > ModelResolver cannot be null > > > Key: MNG-6495 > URL: https://issues.apache.org/jira/browse/MNG-6495 > Project: Maven > Issue Type: Bug > Components: Bootstrap Build >Affects Versions: 3.5.4 >Reporter: Elliotte Rusty Harold >Priority: Major > > Got this exception stacktrace while writing some of my own code today: > Exception in thread "main" java.lang.NullPointerException: > request.modelResolver cannot be null (parent POM > com.google.guava:guava-parent:26.0-jre and POM > com.google.guava:guava:[unknown-version]) > at org.apache.commons.lang3.Validate.notNull(Validate.java:225) > at > org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1046) > at > org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830) > at > org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332) > at > com.google.cloud.tools.opensource.dependencies.MetadataExplorer.main(MetadataExplorer.java:50) > No big deal except that the JavaDoc at > http://maven.apache.org/ref/3.5.4/maven-model-builder/apidocs/org/apache/maven/model/building/ModelBuildingRequest.html > says "The model resolver to use, may be null." > Not sure whether to update the docs or the code here. -- This message was sent by Atlassian JIRA (v7.6.3#76005)