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
Mark Missing Local Artifacts as optional #23245
Changes from 2 commits
70d273b
5e88930
94689e2
d85ce80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2022 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.gradle.integtests.resolve | ||
|
||
import org.gradle.integtests.fixtures.AbstractIntegrationSpec | ||
import spock.lang.Issue | ||
|
||
@Issue("https://github.com/gradle/gradle/pull/23245") | ||
class ResolvePOMSpec extends AbstractIntegrationSpec { | ||
def "resolving a @pom artifact from an included build replacing an external library doesn't fail the build"() { | ||
given: | ||
def mainProjectDir = file("main-project") | ||
def includedLoggingProjectDir = file("included-logging") | ||
|
||
mainProjectDir.file("settings.gradle.kts").text = """ | ||
rootProject.name = "main-project" | ||
include("app") | ||
includeBuild("../included-logging") | ||
""" | ||
|
||
mainProjectDir.file("app/build.gradle.kts").text = """ | ||
plugins { | ||
application | ||
} | ||
|
||
dependencies { | ||
implementation("org.gradle.repro:lib@pom") | ||
} | ||
""" | ||
|
||
includedLoggingProjectDir.file("settings.gradle.kts").text = """ | ||
rootProject.name = "included-logging" | ||
include("lib") | ||
""" | ||
|
||
includedLoggingProjectDir.file("lib/build.gradle.kts").text = """ | ||
plugins { | ||
`java-library` | ||
} | ||
""" | ||
|
||
includedLoggingProjectDir.file("gradle.properties").text = """ | ||
group=org.gradle.repro | ||
version=0.1.0-SNAPSHOT | ||
""" | ||
|
||
executer.inDirectory(mainProjectDir) | ||
|
||
expect: | ||
succeeds "build" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,4 +98,9 @@ public boolean equals(Object obj) { | |
MissingLocalArtifactMetadata other = (MissingLocalArtifactMetadata) obj; | ||
return other.componentIdentifier.equals(componentIdentifier) && other.name.equals(name); | ||
} | ||
|
||
@Override | ||
public boolean isOptionalArtifact() { | ||
return true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a method I am super familiar with. And looks like we have tests that fail because of the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So my previous test run succeeded here, then my only change after was to add a new integration test. So that's a little strange. I was looking for failing tests and when I didn't see any assumed we could mark missing but local metadata artifacts as optional so that we don't throw an exception when trying to |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant to link to the issue here?