Visitar URL original
Fix maven.mainClass property missing for external tools (#10998) · apache/maven@4e50e95 · GitHub
Skip to content

Commit 4e50e95

Browse files
authored
Fix maven.mainClass property missing for external tools (#10998)
Fixes #10996 When external tools like IntelliJ launch Maven directly using the ClassWorlds launcher without setting the maven.mainClass system property, Maven fails with 'No such property: maven.mainClass'. This change adds a default value for maven.mainClass in m2.conf so that external tools can launch Maven without needing to know about this property. The default value is org.apache.maven.cling.MavenCling which is the standard Maven CLI entry point. The fix maintains backward compatibility - Maven launcher scripts continue to work normally by setting the property explicitly, while external tools now have a sensible default.
1 parent cb9c4f1 commit 4e50e95

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • apache-maven/src/assembly/maven/bin

‎apache-maven/src/assembly/maven/bin/m2.conf‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818

19+
set maven.mainClass default org.apache.maven.cling.MavenCling
20+
1921
main is ${maven.mainClass} from plexus.core
2022

2123
set maven.conf default ${maven.home}/conf

0 commit comments

Comments
 (0)