diff --git a/e2e/mavenPluginRows.spec.ts b/e2e/mavenPluginRows.spec.ts
new file mode 100644
index 000000000..1742876a5
--- /dev/null
+++ b/e2e/mavenPluginRows.spec.ts
@@ -0,0 +1,74 @@
+import type { MavenModel } from "../src/platform/ipc";
+import { expect, stubDesktop, test } from "./fixtures";
+
+const maven: MavenModel = {
+ projects: [
+ {
+ pom: "pom.xml",
+ dir: "",
+ groupId: "dev.acme",
+ artifactId: "billing",
+ version: "1.0.0",
+ packaging: "jar",
+ displayName: "Billing",
+ parent: null,
+ modules: [],
+ aggregated: false,
+ plugins: [
+ {
+ groupId: "org.apache.maven.plugins",
+ artifactId: "maven-surefire-plugin",
+ version: "3.2.5",
+ prefix: "surefire",
+ goals: ["test"],
+ },
+ ],
+ dependencies: [],
+ profiles: [],
+ javaVersion: 21,
+ command: "mvn",
+ options: [],
+ env: {},
+ },
+ ],
+ profiles: [],
+ syncedAt: 1,
+ stale: false,
+ syncError: null,
+};
+
+test("Maven plugin rows give the name priority over coordinates in narrow docks", async ({ workbench: page }) => {
+ await stubDesktop(page);
+ await page.evaluate(async (maven) => {
+ window.__ipc.handlers.build_model = () => ({ maven, gradle: [] });
+ const buildModule = "/src/features/build-tools/store.ts";
+ const { loadModel, setExpanded } = await import(/* @vite-ignore */ buildModule);
+ await loadModel();
+ setExpanded("maven", new Set(["mvn:pom.xml", "mvn:pom.xml:plugins"]));
+ const dockModule = "/src/workbench/toolwindows/store.ts";
+ const { showToolWindow, setToolWindowSize } = await import(/* @vite-ignore */ dockModule);
+ showToolWindow("maven", true);
+ setToolWindowSize("right", 190);
+ }, maven);
+
+ const tree = page.getByRole("tree", { name: "Maven projects" });
+ const coordinates = "(org.apache.maven.plugins:maven-surefire-plugin:3.2.5)";
+ const plugin = tree.getByRole("treeitem", { name: `surefire ${coordinates}`, exact: true });
+ const name = plugin.getByText("surefire", { exact: true });
+ const metadata = plugin.getByText(coordinates, { exact: true });
+ await expect(name).toBeVisible();
+ await expect(metadata).toHaveAttribute("title", coordinates);
+ const fit = (el: Element) => {
+ const range = document.createRange();
+ range.selectNodeContents(el);
+ return range.getBoundingClientRect().width <= el.getBoundingClientRect().width;
+ };
+ expect(await name.evaluate(fit)).toBe(true);
+ expect(await metadata.evaluate(fit)).toBe(false);
+ expect(await metadata.evaluate((el) => getComputedStyle(el).color)).not.toBe(
+ await name.evaluate((el) => getComputedStyle(el).color),
+ );
+
+ await plugin.locator("[data-tree-toggle]").click();
+ await expect(tree.getByRole("treeitem", { name: "surefire:test", exact: true })).toBeVisible();
+});
diff --git a/src/features/build-tools/BuildToolView.tsx b/src/features/build-tools/BuildToolView.tsx
index ede27e7e8..a0398afd2 100644
--- a/src/features/build-tools/BuildToolView.tsx
+++ b/src/features/build-tools/BuildToolView.tsx
@@ -31,6 +31,7 @@ import {
mavenRoots,
nodeIcon,
nodeLabel,
+ pluginCoordinates,
profileChecked,
withGradleOptions,
gradleHasTestTask,
@@ -310,6 +311,8 @@ function NodeRow({ node, state }: { node: BuildNode; state: TreeRowState }) {
);
}
+ const plugin = node.kind === "plugin" ? node.plugin : null;
+ const coordinates = plugin && `(${pluginCoordinates(plugin)})`;
const detail =
node.kind === "profiles" && node.projectRoot
? node.projectRoot.split("/").pop()
@@ -321,12 +324,24 @@ function NodeRow({ node, state }: { node: BuildNode; state: TreeRowState }) {
const skipped =
(mavenSkipTests && node.kind === "phase" && node.phase === "test") ||
(gradleSkipTests && node.kind === "task" && node.task.name === "test");
+ const label = (
+
+ {plugin?.prefix ?? nodeLabel(node)}
+
+ );
return (
-
- {nodeLabel(node)}
-
+ {coordinates ? (
+
+ {label}
+
+ {coordinates}
+
+
+ ) : (
+ label
+ )}
{detail && {detail}}
);
diff --git a/src/features/build-tools/BuildTools.module.css b/src/features/build-tools/BuildTools.module.css
index 3bd08d32d..328d4deea 100644
--- a/src/features/build-tools/BuildTools.module.css
+++ b/src/features/build-tools/BuildTools.module.css
@@ -96,6 +96,18 @@
overflow: hidden;
text-overflow: ellipsis;
}
+.pluginText {
+ display: flex;
+ align-items: center;
+ gap: var(--space-1-5);
+ min-width: 0;
+ overflow: hidden;
+}
+.pluginText > .label {
+ flex: none;
+ min-width: 0;
+ max-width: 100%;
+}
.profile {
min-width: 0;
}
diff --git a/src/features/build-tools/model.ts b/src/features/build-tools/model.ts
index f84f12379..2affd51db 100644
--- a/src/features/build-tools/model.ts
+++ b/src/features/build-tools/model.ts
@@ -99,8 +99,8 @@ export function dependencyLabel(d: MavenDependency): string {
return parts.join(":");
}
-export function pluginLabel(p: MavenPlugin): string {
- return `${p.prefix} (${p.groupId}:${p.artifactId}${p.version ? `:${p.version}` : ""})`;
+export function pluginCoordinates(p: MavenPlugin): string {
+ return `${p.groupId}:${p.artifactId}${p.version ? `:${p.version}` : ""}`;
}
/** Profile choices in different workspace members are independent. */
@@ -363,7 +363,7 @@ export function nodeLabel(node: BuildNode): string {
case "plugins":
return tx("Plugins");
case "plugin":
- return pluginLabel(node.plugin);
+ return `${node.plugin.prefix} (${pluginCoordinates(node.plugin)})`;
case "goal":
return `${node.plugin.prefix}:${node.goal}`;
case "dependencies":