You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: astro-docs/src/content/docs/technologies/java/maven/introduction.mdoc
+22-4Lines changed: 22 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ This plugin requires:
27
27
- **Java 17 or newer** - Using older Java versions is unsupported and may lead to issues.
28
28
- **Maven 3.6.0 or newer** - Older Maven versions are not supported.
29
29
30
-
If you need support for an older version, please create an issue on [Github](https://github.com/nrwl/nx)!
30
+
If you need support for an older version, please create an issue on [GitHub](https://github.com/nrwl/nx)!
31
31
{% /aside %}
32
32
33
33
## Setup @nx/maven
@@ -97,7 +97,7 @@ The `@nx/maven` plugin automatically detects Maven projects in your workspace by
97
97
98
98
To view inferred tasks for a project, open the [project details view](/docs/features/explore-graph#explore-projects-in-your-workspace) in Nx Console or run `nx show project my-project` in the command line.
99
99
100
-
## Setting Up @nx/maven in a Nx Workspace
100
+
## Setting Up @nx/maven in an Nx Workspace
101
101
102
102
In any Nx workspace, you can install `@nx/maven` by running the following command:
103
103
@@ -107,13 +107,31 @@ nx add @nx/maven
107
107
108
108
## @nx/maven Configuration
109
109
110
-
The `@nx/maven` is configured in the `plugins` array in `nx.json`.
110
+
The `@nx/maven` plugin is configured in the `plugins` array in `nx.json`.
111
111
112
112
```json
113
113
// nx.json
114
114
{
115
-
"plugins": ["@nx/maven"]
115
+
"plugins": [
116
+
{
117
+
"plugin": "@nx/maven",
118
+
"options": {
119
+
"targetNamePrefix": "mvn-",
120
+
"verbose": false
121
+
}
122
+
}
123
+
]
116
124
}
117
125
```
118
126
119
127
Once the plugin has been added, `@nx/maven` will automatically retrieve information about projects from Maven and create targets for each phase, goal, and some additional targets for CI.
128
+
129
+
### Target Name Prefix
130
+
131
+
In a polyglot workspace supporting projects in different languages, you may have targets with the same name (e.g., `build`, `test`) but different behaviors. By default, Maven phase and goal names are used directly as Nx target names. Use the `targetNamePrefix` option to prefix all Maven targets with a custom string to distinguish them from other targets in your workspace.
132
+
133
+
For example, with `"targetNamePrefix": "mvn-"`, Nx will create targets with the prefix `mvn-` for your targets as `mvn-compile`, `mvn-test`, `mvn-package`, etc.
134
+
135
+
### Verbose
136
+
137
+
Set the `verbose` option to `true` to enable detailed logging from the Maven analyzer. This can be useful for debugging project graph issues. This can also be enabled by setting the `NX_VERBOSE_LOGGING` environment variable.
0 commit comments