Skip to content

Commit

Permalink
GH-536 recognizer for Maven Wrapper added
Browse files Browse the repository at this point in the history
  • Loading branch information
thurka committed Nov 27, 2023
1 parent 2de679f commit efca017
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Expand Up @@ -46,6 +46,7 @@ DESCR_JDeveloperApplicationType=Oracle JDeveloper is a free integrated developme
DESCR_IntelliJPlatformApplicationType=The IntelliJ Platform is a platform for building smart, language-aware IDEs with a comprehensive set of components.
DESCR_EclipseApplicationType=Eclipse is an open-source community that develops open platforms and products.
DESCR_MavenApplicationType=Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
DESCR_MavenWrapperApplicationType=The Maven Wrapper is an easy way to ensure a user of Maven build has everything necessary to run Maven build.
DESCR_Ant=Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles.
DESCR_GlassFish=GlassFish is an open source application server for the Java EE platform.
DESCR_Tomcat=Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies.
Expand Down
Expand Up @@ -34,10 +34,11 @@
*/
public class MavenApplicationType extends MainClassApplicationType {

MavenApplicationType(Application app) {
super(app, "Apache Maven", NbBundle.getMessage( // NOI18N
MainClassApplicationType.class, "DESCR_MavenApplicationType"), // NOI18N
"org/graalvm/visualvm/application/type/resources/Maven2Icon.png"); // NOI18N
MavenApplicationType(Application app, boolean wrapper) {
super(app,
wrapper ? "Apache Maven Wrapper" : "Apache Maven", // NOI18N
NbBundle.getMessage(MavenApplicationType.class, wrapper ? "DESCR_MavenWrapperApplicationType" : "DESCR_MavenApplicationType"), // NOI18N
"org/graalvm/visualvm/application/type/resources/Maven2Icon.png"); // NOI18N
}

}
Expand Up @@ -38,6 +38,7 @@ public class MavenApplicationTypeFactory extends MainClassApplicationTypeFactory
private static final String MAIN_CLASS_1 = "org.codehaus.plexus.classworlds.launcher.Launcher"; // NOI18N
private static final String PROP_1 = "-Dclassworlds.conf="; // NOI18N
private static final String PROP_2 = "-Dmaven.home="; // NOI18N
private static final String WRAPPER_MAIN_CLASS = "org.apache.maven.wrapper.MavenWrapperMain"; // NOI18N

/**
* Detects Apache Maven. It returns
Expand All @@ -51,10 +52,13 @@ public ApplicationType createApplicationTypeFor(Application app, Jvm jvm, String
String args = jvm.getJvmArgs();
if (args != null) {
if (args.contains(PROP_1) && args.contains(PROP_2)) {
return new MavenApplicationType(app);
return new MavenApplicationType(app, false);
}
}
}
if (WRAPPER_MAIN_CLASS.equals(mainClass)) {
return new MavenApplicationType(app, true);
}
return null;
}

Expand Down

0 comments on commit efca017

Please sign in to comment.