You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dino2895 (via GitHub)" <gi...@apache.org> on 2026/08/04 09:45:38 UTC

[PR] KAFKA-20853: Support file-based Maven publishing [kafka]

dino2895 opened a new pull request, #23073:
URL: https://github.com/apache/kafka/pull/23073

   This PR skip Maven credentials for `file:` repositories because Gradle's file
   transport does not support authentication.
   
   Apply the same fix to the api-checker build and correct the file URI example
   in the README.
   
   Tests:
   - File publishing for `clients` and `api-checker:core`
   - `./gradlew spotlessCheck`
   - `git diff --check`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20853: Support file-based Maven publishing [kafka]

Posted by "dejan2609 (via GitHub) via jira" <ji...@kafka.apache.org>.
dejan2609 commented on code in PR #23073:
URL: https://github.com/apache/kafka/pull/23073#discussion_r4445005088


##########
README.md:
##########
@@ -306,7 +306,7 @@ These take the same arguments as the built-in variants.
 The following options should be set with a `-P` switch, for example `./gradlew -PmaxParallelForks=1 test`.
 
 * `commitId`: sets the build commit ID as .git/HEAD might not be correct if there are local commits added for build purposes.
-* `mavenUrl`: sets the URL of the maven deployment repository (`file://path/to/repo` can be used to point to a local repository).
+* `mavenUrl`: sets the URL of the Maven deployment repository (`file:///absolute/path/to/repo` can be used to point to a local repository).

Review Comment:
   Hi @dino2895 and sorry for the delay.
   
   I confirmed it works: 
   `./gradlew -PmavenUrl=file:///tmp/maven-test-repo :clients:publishMavenJavaPublicationToMavenRepository` succeeds.
   
   However, I think it goes a bit further than the ticket needs. In the[ Jira comment ](https://issues.apache.org/jira/browse/KAFKA-20853?focusedId=18099763&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-18099763) @chia7712 suggested:
   
   ```
   I think we could just remove the comment "// To test locally, invoke gradlew with
   `-PmavenUrl=file:///some/local/path`", since we could leverage `publishToMavenLocal` instead`
   ```
   
   That leaves us with these two cases:
   1. **local publishing** --> `./gradlew publishToMavenLocal`, which works as expected on both trunk and this PR
   2. **remote publishing** --> `-PmavenUrl=...` + credentials (used by `release.py`)
   
   So my suggestion would be to reduce this PR to:
   - `build.gradle`: remove the `// To test locally ...` comment and keep the `publishing {}` block as in trunk
   - `README.md`: update the `mavenUrl` entry, for example:
     - describe it as the URL of the **remote** Maven repository
     - mention `publishToMavenLocal` as the way to publish locally
     - drop the `file:///absolute/path/to/repo` hint
   - `api-checker/build.gradle`: no change



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20853: Support file-based Maven publishing [kafka]

Posted by "github-actions[bot] (via GitHub) via jira" <ji...@kafka.apache.org>.
github-actions[bot] commented on PR #23073:
URL: https://github.com/apache/kafka/pull/23073#issuecomment-6538269473

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20853: Support file-based Maven publishing [kafka]

Posted by "dejan2609 (via GitHub) via jira" <ji...@kafka.apache.org>.
dejan2609 commented on code in PR #23073:
URL: https://github.com/apache/kafka/pull/23073#discussion_r4453348185


##########
build.gradle:
##########
@@ -389,12 +389,13 @@ subprojects {
 
     publishing {
       repositories {
-        // To test locally, invoke gradlew with `-PmavenUrl=file:///some/local/path`

Review Comment:
   As per longer comment: remove `// To test locally ...` comment and keep the `publishing {}` block code as in trunk.



##########
api-checker/build.gradle:
##########
@@ -103,10 +103,13 @@ subprojects {
             // come from ~/.gradle/gradle.properties via the same -PmavenUrl / -PmavenUsername /
             // -PmavenPassword properties release.py uses.
             maven {
-                url = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
-                credentials {
-                    username = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
-                    password = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
+                def repositoryUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
+                url = repositoryUrl
+                if (!repositoryUrl || !'file'.equalsIgnoreCase(uri(repositoryUrl).scheme)) {
+                    credentials {
+                        username = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
+                        password = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
+                    }

Review Comment:
   As per longer comment: this change is not required.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20853: Support file-based Maven publishing [kafka]

Posted by "dejan2609 (via GitHub) via jira" <ji...@kafka.apache.org>.
dejan2609 commented on code in PR #23073:
URL: https://github.com/apache/kafka/pull/23073#discussion_r4445005088


##########
README.md:
##########
@@ -306,7 +306,7 @@ These take the same arguments as the built-in variants.
 The following options should be set with a `-P` switch, for example `./gradlew -PmaxParallelForks=1 test`.
 
 * `commitId`: sets the build commit ID as .git/HEAD might not be correct if there are local commits added for build purposes.
-* `mavenUrl`: sets the URL of the maven deployment repository (`file://path/to/repo` can be used to point to a local repository).
+* `mavenUrl`: sets the URL of the Maven deployment repository (`file:///absolute/path/to/repo` can be used to point to a local repository).

Review Comment:
   My suggestion for `mavenUrl` entry:
     - describe it as the URL of the **remote** Maven repository
     - mention `publishToMavenLocal` as the way to publish locally
     - drop the `file:///absolute/path/to/repo` hint



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20853: Support file-based Maven publishing [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23073:
URL: https://github.com/apache/kafka/pull/23073#issuecomment-5262039231

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20853: Support file-based Maven publishing [kafka]

Posted by "dejan2609 (via GitHub)" <gi...@apache.org>.
dejan2609 commented on PR #23073:
URL: https://github.com/apache/kafka/pull/23073#issuecomment-6340894278

   Hi @dino2895, I’m reviewing this now and will post comments within a few days.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org