Yayın için test fikstürlerini yapılandırın
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Test armatürlerinin yayınlanması özel bir yapılandırma gerektirmese de
yayının,
yetenek mekanizması
kullanımı için ek yapılandırma gerekir.
groupId:artifactId:version
koordinatlarına sahip belirli bir eser için, Gradle
test armatürlerinin eserinin koordinatlarla bir yeteneği tanımlamasını
groupId:artifactId-test-fixtures:version
. Bu işlem şu anda tamamlanmadı
test armatürü desteği veya Maven yayınlama eklentisi tarafından otomatik olarak yapılır.
Bu nedenle manuel olarak yapılmalıdır.
Gradle bu özelliği projenin adından, grubundan ve sürümünden oluşturur.
Üçünün de artifactId
, groupId
ve version
grubuyla eşleşecek şekilde ayarlanması gerekir
yayınlayacağım.
Projenin adı, varsayılan olarak yolunun son segmentidir. Bu nedenle
:path:to:mylibrary
yoluna sahip bir projenin adı mylibrary
. Bu
artifactId
için kullanmak istediklerinizi bulamadıysanız projenizi değiştirmeniz gerekir
dokunun.
Projenizi yeniden adlandırmak için iki seçenek vardır:
- Proje klasörünü yeniden adlandırın. Bu, proje adını veya
Projenin Gradle yolu. Bu nedenle projeye dahil olan tüm bağımlılıklar
güncellendi. Proje adını ve klasörü aynı tutmak
daha fazla düzenleme çalışması yaparak kafa karışıklığını azaltabilir.
- Proje klasörünü yeniden adlandırmadan Gradle'da projeyi yeniden adlandırın. Bu
kaynak sürümü oluşturma üzerindeki etkiyi önler ancak proje konumunu böler
ve adı.
Gradle'daki projeyi yeniden adlandırmak için aşağıdaki kodu
settings.gradle
dosyası:
Eski
include ':path:to:mylibrary'
project(':path:to:mylibrary').name = 'my-library'
Kotlin
include(":path:to:mylibrary")
project(":path:to:mylibrary").name = "my-library"
Bu kod, projenin yeni yolunu :path:to:my-library
kullanıcısına atar.
groupId
değeri varsayılan olarak derleme adına gelir. Bu genellikle
kök klasördür ve version
değeri varsayılan olarak belirtilmemiştir. Değiştirmek için
grup kimliği veya sürümünün değerlerini girin, group
ve version
özelliklerini ayarlayın,
sırasıyla proje düzeyindeki build.gradle
dosyanızda (Groovy için) veya
build.gradle.kts
(Kotlin komut dosyası için):
Eski
group = 'com.my-company'
version = '1.0'
Kotlin
group = "com.my-company"
version = "1.0"
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-27 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-27 UTC."],[],[],null,["# Configure test fixtures for publication\n\nWhile publishing test fixtures doesn't require any particular configuration\nof the publication, the\n[capability mechanism](https://docs.gradle.org/current/userguide/component_capabilities.html)\nused to handle fixtures does require an additional configuration.\n\nFor a given artifact with coordinates `groupId:artifactId:version`, Gradle\nexpects that the test fixtures artifact declares a capability with coordinates\n`groupId:artifactId-test-fixtures:version`. This is not currently done\nautomatically by either the test fixture support or the Maven Publish Plugin,\nand therefore must be done manually.\n\nGradle creates the capability from the project's name, group, and version.\nAll three must be set up to match the `artifactId`, `groupId`, and `version` set\nin the publication.\n\nThe project's name is the last segment of its path by default, so the default\nname of a project with the path `:path:to:mylibrary` is `mylibrary`. If this is\nnot what you want to use for `artifactId`, then you need to change your project\nname.\n\nThere are two options for renaming your project:\n\n- Rename the folder of the project. This changes the project name, or the Gradle path of the project, so all dependencies on the project need to be updated. While keeping the project name and folder the same might create more reorganization work initially, it reduces confusion.\n- Rename the project in Gradle without renaming the folder of the project. This avoids the impact on source versioning, but it splits the project location and name.\n\nTo rename the project in Gradle, insert the following code in the\n`settings.gradle` file: \n\n### Groovy\n\n```groovy\ninclude ':path:to:mylibrary'\nproject(':path:to:mylibrary').name = 'my-library'\n```\n\n### Kotlin\n\n```kotlin\ninclude(\":path:to:mylibrary\")\nproject(\":path:to:mylibrary\").name = \"my-library\"\n```\n\nThis code assigns the new path of the project to `:path:to:my-library`.\n\nThe value `groupId` defaults to the build name, which is generally the name of\nthe root folder, and the value `version` is by default unspecified. To change\nthe values of the group ID or version, set the `group` and `version` properties,\nrespectively, in your project-level `build.gradle` file (for Groovy) or\n`build.gradle.kts` (for Kotlin script): \n\n### Groovy\n\n```groovy\ngroup = 'com.my-company'\nversion = '1.0'\n```\n\n### Kotlin\n\n```kotlin\ngroup = \"com.my-company\"\nversion = \"1.0\"\n```"]]