부모 pom에서 glassfish에 배포

Nightowl

부모 pom에서 glassfish4에 배포하고 싶지만 항상 다음 오류 메시지가 나타납니다.

No plugin found for prefix 'glassfish' in the current project and in the plugin groups
[org.apache.maven.plugins, org.codehaus.mojo] available from the repositories 
[local (c:\Programs\Server\.m2\repository), central (http://repo.maven.apache.org/maven2)]

내 부모 pom에는 여러 모듈이 있으며 그중 두 개에 대해 war 파일을 glassfish에 배포하고 싶습니다. 플러그인 코드를 모듈 pom에 작성하고 모듈 만 실행하면 작동합니다. 그러나 프로필 내에서 부모 pom으로 이동하여 특수 속성을 설정 한 모듈에 대해서만 실행하도록하면 maven이 플러그인을 찾을 수 없습니다.

부모 -pom :

<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>org.glassfish.javaeetutorial.firstcup</groupId>
<artifactId>firstcup</artifactId>
<version>7.0.1</version>
<packaging>pom</packaging>
<name>firstcup</name>

<scm>
    <connection>scm:svn:https://svn.java.net/svn/firstcup~svn/tags/firstcup-7.0.1</connection>
    <developerConnection>scm:svn:https://svn.java.net/svn/firstcup~svn/tags/firstcup-7.0.1</developerConnection>
</scm>
<issueManagement>
    <system>IssueTracker</system>
    <url>http://java.net/jira/browse/FIRSTCUP</url>
</issueManagement>

<modules>
    <module>firstcup-war</module>
    <module>dukes-age</module>
    <module>archetypes</module>
</modules>

<properties>
    <javaee.api.version>7.0</javaee.api.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.plugin.version>3.1</maven.compiler.plugin.version>
    <maven.war.plugin.version>2.3</maven.war.plugin.version>
    <maven.license.plugin.version>1.10.b1</maven.license.plugin.version>
    <deploy.glassfish>false</deploy.glassfish>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <inherited>true</inherited>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
                <debug>true</debug>
                <debuglevel>lines,vars,source</debuglevel>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>${maven.war.plugin.version}</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.mycila.maven-license-plugin</groupId>
            <artifactId>maven-license-plugin</artifactId>
            <version>${maven.license.plugin.version}</version>
            <configuration>
                <header>common/license.txt</header>
                <excludes>
                    <exclude>**/META-INF/**</exclude>
                    <exclude>**/WEB-INF/**</exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
</build>

<profiles>
    <profile>
        <id>deploy-glassfish</id>
        <activation>
            <property>
                <name>deploy.glassfish</name>
                <value>true</value>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.glassfish.maven.plugin</groupId>
                    <artifactId>maven-glassfish-plugin</artifactId>
                    <version>2.1</version>
                    <configuration>
                        <glassfishDirectory>${local.glassfish.home}</glassfishDirectory>
                        <user>${local.glassfish.user}</user>
                        <passwordFile>${local.glassfish.passfile}</passwordFile>
                        <domain>
                            <name>${local.glassfish.domain}</name>
                            <httpPort>${local.glassfish.httpport}</httpPort>
                            <adminPort>${local.glassfish.adminport}</adminPort>
                        </domain>
                        <components>
                            <component>
                                <name>${project.name}</name>
                                <artifact>target/${project.name}-${project.version}.war</artifact>
                            </component>
                        </components>
                        <debug>true</debug>
                        <terse>false</terse>
                        <echo>true</echo>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>


<dependencies>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>${javaee.api.version}</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>java.net-maven2-repository</id>
        <name>Java.net Repository for Maven</name>
        <url>https://maven.java.net/content/repositories/staging/</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>Java EE 7</id>
        <url>https://maven.java.net/content/groups/promoted/</url> 
    </repository>
</repositories>

어린이 pom :

<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <artifactId>firstcup</artifactId>
    <groupId>org.glassfish.javaeetutorial.firstcup</groupId>
    <version>7.0.1</version>
</parent>

<artifactId>dukes-age</artifactId>
<groupId>org.glassfish.javaeetutorial.firstcup</groupId>
<packaging>war</packaging>
<name>dukes-age</name>

<properties>
    <deploy.glassfish>true</deploy.glassfish>
</properties>

Tmarouane

glassfish-maven-plugin아래 빌드-> pluginManagement부모 pom 아래 로 이동하십시오 .

<pluginManagement>
    <plugins>
            <plugin>
                <groupId>org.glassfish.maven.plugin</groupId>
                <artifactId>maven-glassfish-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <glassfishDirectory>${local.glassfish.home}</glassfishDirectory>
                    <user>${local.glassfish.user}</user>
                    <passwordFile>${local.glassfish.passfile}</passwordFile>
                    <domain>
                        <name>${local.glassfish.domain}</name>
                        <httpPort>${local.glassfish.httpport}</httpPort>
                        <adminPort>${local.glassfish.adminport}</adminPort>
                    </domain>
                    <components>
                        <component>
                            <name>${project.name}</name>
                            <artifact>target/${project.name}-${project.version}.war</artifact>
                        </component>
                    </components>
                    <debug>true</debug>
                    <terse>false</terse>
                    <echo>true</echo>
                </configuration>
            </plugin>
        </plugins>
</pluginManagement>

그런 다음 자녀 pom 안에 다음 플러그인 호출을 추가하십시오.

<plugins>
  <plugin>
      <groupId>org.glassfish.maven.plugin</groupId>
      <artifactId>maven-glassfish-plugin</artifactId>
  </plugin>
</plugins>

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

TOP 리스트

  1. 1

    Ionic 2 로더가 적시에 표시되지 않음

  2. 2

    JSoup javax.net.ssl.SSLHandshakeException : <url>과 일치하는 주체 대체 DNS 이름이 없습니다.

  3. 3

    std :: regex의 일관성없는 동작

  4. 4

    Xcode10 유효성 검사 : 이미지에 투명성이 없지만 여전히 수락되지 않습니까?

  5. 5

    java.lang.UnsatisfiedLinkError : 지정된 모듈을 찾을 수 없습니다

  6. 6

    rclone으로 원격 디렉토리의 모든 파일을 삭제하는 방법은 무엇입니까?

  7. 7

    상황에 맞는 메뉴 색상

  8. 8

    SMTPException : 전송 연결에서 데이터를 읽을 수 없음 : net_io_connectionclosed

  9. 9

    정점 셰이더에서 카메라에서 개체까지의 XY 거리

  10. 10

    Windows cmd를 통해 Anaconda 환경에서 Python 스크립트 실행

  11. 11

    다음 컨트롤이 추가되었지만 사용할 수 없습니다.

  12. 12

    C #에서 'System.DBNull'형식의 개체를 'System.String'형식으로 캐스팅 할 수 없습니다.

  13. 13

    JNDI를 사용하여 Spring Boot에서 다중 데이터 소스 구성

  14. 14

    Cassandra에서 버전이 지정된 계층의 효율적인 모델링

  15. 15

    복사 / 붙여 넣기 비활성화

  16. 16

    Android Kotlin은 다른 활동에서 함수를 호출합니다.

  17. 17

    Google Play Console에서 '예기치 않은 오류가 발생했습니다. 나중에 다시 시도해주세요. (7100000)'오류를 수정하는 방법은 무엇입니까?

  18. 18

    SQL Server-현명한 데이터 문제 받기

  19. 19

    Seaborn에서 축 제목 숨기기

  20. 20

    ArrayBufferLike의 typescript 정의의 깊은 의미

  21. 21

    Kubernetes Horizontal Pod Autoscaler (HPA) 테스트

뜨겁다태그

보관