Import Maven Projects with groupId + artifactId + version to avoid duplicate error on import
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- java, vscode
研究方向
Start by tracing the Maven project import flow in the vscode-java extension and how it detects duplicate groupId/artifactId values; the issue does not name files or tests. Check how import identity is formed and whether the existing maven.explorer.projectName setting participates. Done when the two sample projects with versions 1.0 and 2.0 can both be imported without duplicate errors.
由索引模型根據 Issue 內容生成。
描述
The Problem
On importing Java projects we get errors like this:
23 Maven project(s) could not be imported due to duplicate groupId/artifactId. See the language server log for details.
We are using a multi-root workspace:
- Each root folder imports a Java multi-project project from a seperate git local repo.
- Each repo / folder is a set to a different release branch from the same git repo.
This means that each root folder contains substantially the same set of maven projects, with the same groupId(s) and artifactId(s), but with different version(s).
i.e. as indicated by the error, groupId + artifactId is duplicate / ambiguous,
but the combination groupId + artifactId + version is unique.
For our maven projects the property name is also unique.
Proposed Solution
It should be possible to configure which maven properties are used to import maven projects:
e.g. groupId + artifactId + version
or groupId + artifactId + name
Note the Eclipse IDE when properly configured supports our project structure. Eclipse is able make otherwise duplicate maven projects unique on import via the "Import Maven Projects / Advanced / Name Template" option.
Describe alternatives you've considered
We have seen the setting "maven.explorer.projectName": "${project.groupId}.${project.artifactId}-${project.version}", but that has no effect on project import.
How to Reproduce
The issue can be demonstrated with:
A trusted multi-root-workspace "foo" with two folders foo_one and foo_two imported:
workspace "foo"
├─foo_one
│ └── demo
│ └── pom.xml
└─foo_two
└── demo
└── pom.xml
foo_one is a maven project with this pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar</groupId>
<artifactId>demo</artifactId>
<version>1.0</version>
<properties>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
</properties>
</project>
foo_two is a maven project with this pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar</groupId>
<artifactId>demo</artifactId>
<version>2.0</version>
<properties>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
</properties>
</project>
The projects differ only in the version (1.0) vs (2.0)
My Setup
IBM Bob Version: 1.126.0+bob2.2.3
VSCode Version: 1.126.0
Bob Version: 2.2.3
Extension Pack for Java 0.31.2
Language Suppor for Java(TM) by RedHat pre-release 1.59.2026102008
Maven for Java 0.45.3
OS: Darwin arm64 27.0.0
- 主要語言
- TypeScript
- 星號
- 2.3k
- 分支
- 550
- 平均合併
- 4 天 5 小時
- 30 天內合併 PR
- 14
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
redhat-developer/vscode-java 的其他 Issue
-
bug
難度 3/5 1-2 天 新手友好度 55/100
redhat-developer/vscode-java#4550 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 48/100
redhat-developer/vscode-java#4537 ·
維護者通常 1 天內回覆
-
bug need info
難度 4/5 3-5 天 新手友好度 35/100
redhat-developer/vscode-java#4520 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
redhat-developer/vscode-java#4517 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug documentation
難度 3/5 1-2 天 新手友好度 25/100
redhat-developer/vscode-java#4516 · 1 則留言 ·
維護者通常 1 天內回覆
查看 redhat-developer/vscode-java 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
maniator/verticopolis#1303 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 73/100
components-web-app/docs#297 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
appwrite/mcp-for-docs#23 · 1 則留言 ·
-
`@vanilla-extract/turbopack-plugin`: "getImageSize is not a function" with Next.js 16.4.x when a `.css.ts` file imports an image可能已有人在做 @aevarOrigo 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
vanilla-extract-css/vanilla-extract#1799 · 1 則留言 ·
-
native
難度 2/5 1-3 小時 新手友好度 72/100
prime-radiant-inc/evener#4839 ·
維護者通常 1 天內回覆