maven startet jetty, netbeans "run" startet glassfish

Hallo,


Netbeans startet "intuitiv" den Glassfish mit F6/Run, aber bisher hatte ich auch, zumindest bei anderen Projekten, mit site:run von maven eine lauffähige Software.

Woher weiß Netbeans das es Glassfish starten soll?

Hier die pom.xml:
Code:
<?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>com.mycompany</groupId>
    <artifactId>Whiteboard_2</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>Whiteboard_2</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
   
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
 
Ehrlich gesagt ist das hier wohl das falsche Forum, dieser Thread gehört wohl eher hier hin:
https://www.java-forum.org/forum/java-basics-anfaenger-themen.17/
Dieses Forum ist für (fortgeschrittene) allgemeine Java Themen:
https://www.java-forum.org/forum/allgemeine-java-themen.10/
Wie du deine IDE benutzt, ist definitv ein Anfänger Thema!

Aber ich will dir trotzdem helfen:
Jede IDE besitzt eine RUN Configuration, in der man dies einstellen kann. Anscheinend ist Netbeans aber so schlau, dass es die pom.xml ausliest und wegen dem Maven maven-war-plugin einen Glassfish Server startet, also beim Initialisieren (Erstellen / Importieren) des Projektes automatisch diese RUN Konfiguration angelegt hat.
 
Oh, ganz vergessen zu Antworten.

nb-configuration.xml ist im Projekt Order mit diesem Inhalt zu finden:
Code:
    <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
        <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
        <org-netbeans-modules-projectapi.jsf_2e_language>Facelets</org-netbeans-modules-projectapi.jsf_2e_language>
    </properties>
</project-shared-configuration>

Daher wird Netbeans wohl die Information "nimm glassfish" haben.
 

Zurück
Oben