Import Maven Projects with groupId + artifactId + version to avoid duplicate error on import
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java, vscode
- Bereich
- developer-experience, tooling
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 550
- Ø Merge
- 4 T. 5 Std.
- Gemergte PRs (30 T.)
- 14
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus redhat-developer/vscode-java
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
redhat-developer/vscode-java#4550 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
redhat-developer/vscode-java#4537 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug need info
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
redhat-developer/vscode-java#4520 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
redhat-developer/vscode-java#4517 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Red Hat Not ActivatingOffenbug documentation
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
redhat-developer/vscode-java#4516 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in redhat-developer/vscode-java
Ähnliche Issues
-
数据界面的横向滚动条缺失Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
zilliztech/attu#1037 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
openclaw/openclaw#181212 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apify/apify-mcp-server#1684 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Automattic/data-liberation-agent#953 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
siteboon/claudecodeui#1642 ·
Maintainer antworten meist innerhalb von 5 Tagen