Using '-' as separator between GroupID and ArtifactID (Maven) is a poor choice - not unique. #13895

Closed
opened 2025-11-02 10:56:26 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @JWT007 on GitHub (Dec 29, 2024).

Description

Copied from discussion in [30568] - originally for a different issue and now closed with pending PR.

Gitea made a poor descision (IMHO) to use the separator '-' between groupID and artifactID.

Consider the following:

<groupId>foo</groupId>
<artifactId>bar-jdbc</artifactId>
<version>1-SNAPSHOT</version>

<groupId>foo-bar</groupId>
<artifactId>jdbc</artifactId>
<version>1-SNAPSHOT</version>

Both result in the same URL:
packages/maven/foo-bar-jdbc/1-SNAPSHOT

Although a '-' in a groupID is not "good-practice", it is not forbidden and perfectly valid and in common use.

For example:

<dependency>
    <groupId>commons-lang.wso2</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.6.0.wso2v1</version>
</dependency>

Gitea Version

1.22.6

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Linux

How are you running Gitea?

Database

PostgreSQL

Originally created by @JWT007 on GitHub (Dec 29, 2024). ### Description Copied from discussion in [[30568](https://github.com/go-gitea/gitea/issues/30568)] - originally for a different issue and now closed with pending PR. Gitea made a poor descision (IMHO) to use the separator '-' between groupID and artifactID. Consider the following: ``` <groupId>foo</groupId> <artifactId>bar-jdbc</artifactId> <version>1-SNAPSHOT</version> <groupId>foo-bar</groupId> <artifactId>jdbc</artifactId> <version>1-SNAPSHOT</version> ``` Both result in the same URL: packages/maven/foo-bar-jdbc/1-SNAPSHOT Although a '-' in a groupID is not "good-practice", it is not forbidden and perfectly valid and in common use. For example: ``` <dependency> <groupId>commons-lang.wso2</groupId> <artifactId>commons-lang</artifactId> <version>2.6.0.wso2v1</version> </dependency> ``` ### Gitea Version 1.22.6 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Linux ### How are you running Gitea? - ### Database PostgreSQL
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 10:56:26 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Dec 29, 2024):

Will fix it in 1.24 (could try to backport but I can't promise)

@wxiaoguang commented on GitHub (Dec 29, 2024): Will fix it in 1.24 (could try to backport but I can't promise)
Author
Owner

@wxiaoguang commented on GitHub (Dec 30, 2024):

Now here it is Refactor maven package registry #33049

@wxiaoguang commented on GitHub (Dec 30, 2024): Now here it is Refactor maven package registry #33049
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13895