Vampire
01/24/2024, 11:12 AMNamed
for attributes like public interface Usage extends Named
?
I mean opposed to just having the attributes with type String
.
In the module metadata they are just strings.
To set them you use the String
constants in the interface.
You can also use any arbitrary other string.
So the only effect I can realize right now is, that it is more cumbersome to set the attributes by needing to use objects.named
to create the value instead of just setting a String
as value.Vampire
01/24/2024, 11:43 AMOPERATING_SYSTEM_ATTRIBUTE
and those having a value for the attribute.
I thought maybe componentFilter
in an ArtifactView
would allow to do that, but it only allows to match on the ComponentIdentifier
. 😕Oleg Nenashev
02/11/2024, 7:14 PMvierbergenlars
02/16/2024, 9:07 AMorg.gradle.jvm.version
attribute set on the outgoing variant so both jars are published and Gradle automatically selects the correct jar in a consuming project. I found this page https://docs.gradle.org/current/userguide/publishing_customization.html, but that doesn't seem to describe the part how I put the correct attribute on the outgoing configuration, and how to associate the output of the Java 17 task with that configuration?Zak Taccardi
02/26/2024, 10:15 PMorg.jetbrains.kotlinx:kotlinx-coroutines-*
)
◦ then include the BOM as a dependency to that configuration as well
is this possible?tony
02/28/2024, 12:47 AM// settings.gradle.kts
gradle.afterProject { p ->
p.dependencies.add("api", platform(project(":platform")))
}
or would I want beforeProject
or even allprojects
?StefMa
02/29/2024, 3:21 PM- Variant 'runtimeElements' capability org.pkl-lang:pkl-codegen-java:0.26.0-SNAPSHOT declares a runtime of a library, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
Can someone help me to understand this 🙈
I don't get it fully.. What is only compatible with Java 11?
And who declares a component that is compatible with Java 17?melix
03/08/2024, 3:49 PMCaleb Cushing
03/19/2024, 1:34 AMerrorprone
scope from my locks, unlocking the dependency. I can't figure out why it's different (correct) locally only. That's kind of good though, if I have the only environment that produces the correct result... then everyone else can reproduce the incorrect one.
I thought I had it figured out, but my automated build still cleans it. This is the last PR where it did it
https://github.com/xenoterracide/spring-app-commons/pull/11
and the job that creates those PR's
https://github.com/xenoterracide/spring-app-commons/blob/main/.github/workflows/update-java.yml
I have verified that errorprone is running in CI (by causing it to fail). No I don't have any init scripts locally, I had vampire test this locally too. I thought I had it. That it was related to using buildScript { depenendencyLocking.lockAllConfigurations() }
instead of buildScript { dependencyLocking { lockAllConfigurations() }}
but I guess that wasn't it.
That build does produce a build scan
https://github.com/xenoterracide/spring-app-commons/actions/runs/8274833680tony
03/19/2024, 5:35 PMguice-4.2.2-no_aop.jar
as a transitive dependency. (com.google.inject:guice:4.2.2
)
I have a java-platform that constrains guice to 6.0.0. These two requirements combined have gradle looking for guice-6.0.0-no_aop.jar
, which doesn't exist. What's the simplest way to tell gradle to drop the no_aop
classifier when trying to resolve guice?Dylan Bolger
03/19/2024, 7:45 PMmavenLocal()
over a RELEASE one living in a Maven Repository? I'd like it where if the artifact exists in mavenLocal, it's preferred and used. Otherwise if a RELEASE version is found, it can be used.
I think this goes against Gradle's typical rules of preferring the highest version first (1.0-RELEASE > 1.0-SNAPSHOT). We have our architecture set up in such a way that doing composite builds isn't practical and we'd like to keep referring to mavenLocal, despite it's pitfalls.
I've seen examples where you can prefer a local dependency on a project(':myProject')
over a artifact coming from elsewhere, but I'm unsure how to take on this approach if the project I'd like to refer to doesn't live in the same code repository/Gradle project space.John
03/22/2024, 2:06 PMMr Maker
05/02/2024, 10:34 PMLeon Linhart
05/07/2024, 10:55 AMVampire
05/16/2024, 4:22 PMdependencies {
runtimeOnly("saxon:saxon:6.5.3")
implementation("net.sourceforge.nekohtml:nekohtml:1.9.22")
}
and do
System.out.println(SAXParserFactory.newInstance().newSAXParser());
You get Aelfred which is shipped with Saxon 6.
But if you do
dependencies {
constraints {
implementation("xerces:xercesImpl:2.12.2")
}
runtimeOnly("saxon:saxon:6.5.3")
implementation("net.sourceforge.nekohtml:nekohtml:1.9.22")
}
you "suddenly" get Xerces.
Actually using
val foo by tasks.registering {
doLast {
configurations.runtimeClasspath.get().forEach { println(it) }
}
}
to output the runtime classpath also shows that the order is not in declaration order anyway.
Without the constraint you first have neko, then saxon, then the neko dependency xerces, then the xerces dependency xml-apis.
With the constraint you first have neko, then xerces, then saxon, then xml-apis.Mateus Moreira
05/17/2024, 11:35 AMProblems reading data from Binary store in C:\Users\user\.gradle\.tmp\gradle17488259925332310792.bin offset 633171 exists? true
Problems loading the resolution results (0.0 secs). Read 338 values, last was: 5
Corrupt serialized resolution result. Cannot find selected component (22228) for constraint apiElements -> net.kyori:adventure-nbt:4.17.0
I have tried deleting the entire cache folder, .gradle, and so many other things and every time it downloads the dependencies it gets stuck here.
The weirdest part is that the same dependency does not cause problems in other projects, only on my main one. How can I figure out what is causing this issue? The full error (https://pastes.dev/cgB1PXmDCz) itself doesn't really tell me what is going on. Could it be an Intellij issue?Gopinath J
05/21/2024, 10:41 AMVampire
05/23/2024, 12:45 PMYi Cheng
05/24/2024, 7:44 PMfoo:bar
, and has published version foo:bar:1.0.0
) .
The issue is that if I run gr A:mima
now, the mima plugin will pass a configuration to resolve with foo:bar:1.0.0
but Gradle will now resolve foo:bar:1.0.0 -> project :A
Wonder if there is any advice on how to approach this to force resolution back to external module instead of internal project? Thank you!Andrew Louis
05/28/2024, 2:24 PMconfigurations.all {
resolutionStrategy {
eachDependency {
if ("${requested.group}" == "io.netty") {
if (requested.name.startsWith("netty-tcnative")) {
useVersion("2.0.65.Final")
} else {
useVersion("4.1.109.Final")
}
}
}
}
}
Running ./gradlew app:dependencyInsight --dependency io.netty:netty-resolver-dns
gives me 4.1.109.Final as expected ✅
io.netty:netty-resolver-dns:4.1.106.Final -> 4.1.109.Final
\--- com.linecorp.armeria:armeria:1.27.3
+--- com.linecorp.armeria:armeria-bom:1.27.3
| \--- compileClasspath
But when I open up the fat JAR and read the pom.properties
for the dependency; I see the following:
From extracted/META-INF/maven/io.netty/netty-resolver-dns/pom.properties:
artifactId=netty-resolver-dns
groupId=io.netty
version=4.1.89.Final
How do I still have a 4.1.89 in there despite dependencyInsight
indicating that I should have a 4.1.109.Final 🤯
This is my script for dumping the JAR deps btw -- https://gist.github.com/andrewloux/863434f893d29848f3a047f8f2093d90Tomáš Procházka
05/29/2024, 7:06 PMdependencyResolutionManagement { repositories {
.
But one of my plugin declaring own repository and for some reason Gradle not allow to use repository from both settings and project, why? Why I must choose just one variant? I would welcome
repositoriesMode.set(RepositoriesMode.ALLOW_BOTH)
Tomáš Procházka
06/14/2024, 8:30 PMExecution failed for task ':app:hiltAggregateDepsDefaulBackendTest'.
> Could not resolve all files for configuration ':app:defaultBackendTestRuntimeClasspath'.
> Failed to transform protobuf-java-3.21.12-lite.jar (com.google.protobuf:protobuf-java:3.21.12) to match attributes {artifactType=aggregated-jar-for-hilt, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find protobuf-java-3.21.12-lite.jar (com.google.protobuf:protobuf-java:3.21.12).
Searched in the following locations:
<https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.12/protobuf-java-3.21.12-lite.jar>
And it makes no sense, there is -lite
classifier, there is nothing like that in reality, the right path is
<https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.12/protobuf-java-3.21.12.jar>
How to found source of that classifier definition please?
Gradle has generally very bad support for maven classifiers
gradlew dependencies
will not print it.
It is even not possible to exclude it.Eug
06/26/2024, 12:51 PMIvan CLOVIS Canet
06/27/2024, 1:44 PMTapchicoma
07/02/2024, 2:55 PMMartin
07/03/2024, 3:11 PMDependencyScopeConfiguration
?Martin
07/03/2024, 4:54 PMconfigurations.register("myConfiguration")
vs configurations.create("myConfiguration")
?Martin
07/03/2024, 11:05 PMRobert Elliot
07/10/2024, 10:37 PMAijaz Baig
07/21/2024, 8:56 PM