프로필 파일을 프로젝트 pom.xml 파일에서 사용하여 특정 서버에 내 war 파일의 배포를 제어하려고합니다. 예를 들어 로컬 프로필과 개발 서버 프로필이 있습니다. 여기에, 내가 대신 내 구성 10.16.21.60
에서 제공하는 IP 주소로 연결을 시도로 볼 수있다, 내 프로필에 내가프로필이있는 Maven Tomcat 배포 플러그인
mvn org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy
나는이 시도 를 호출하고
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>target</name>
<value>local</value>
</property>
</activation>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://10.16.21.60:8080/manager/text</url>
<server>localTomcat</server>
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dev</id>
<activation>
<property>
<name>target</name>
<value>dev</value>
</property>
</activation>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://devserverurl:8080/manager/text</url>
<server>devTomcat</server>
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
</profile>
을 설정하는 방법입니다 대신 localhost
에 연결하려고합니다. devTomcat
과 localTomcat
은 내 로컬 settings.xml
파일에 사용자 이름과 암호로 정의되어 있습니다. 그때 나는 플러그인에 대한 디버그 출력에서 볼 수있는 추가 정보를위한 -X
옵션을 추가하면
은 (강조 추가)
[DEBUG] Configuring mojo org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy from plugin realm ClassRealm[plugin>org.apache.tomcat.maven:tomcat7-maven-plugin:2.2, parent: [email protected]] [DEBUG] Configuring mojo 'org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy' with basic configurator --> [DEBUG] (f) charset = ISO-8859-1 [DEBUG] (f) contextFile = .... [DEBUG] (f) ignorePackaging = false [DEBUG] (f) mode = war [DEBUG] (f) packaging = war [DEBUG] (f) path = ... [DEBUG] (f) update = false [DEBUG] (f) url = http://localhost:8080/manager/text [DEBUG] (f) version = 2.2 [DEBUG] (f) warFile = ... [DEBUG] (f) settings = [email protected] [DEBUG] -- end configuration -- [INFO] Deploying war to http://localhost:8080/... [DEBUG] No server specified for authentication - using defaults
그것은 내 구성 설정이 준수되고 있다는 표시되지 않습니다! 이 방법이 효과가 있다고 생각하는 방식은 local
프로필이 활성화되었으므로 해당 구성을 사용한다는 것입니다.
프로필이없는 내 <build>
섹션에 정의 된 플러그인을 사용해도 동일한 효과가 나타납니다. 항상 인증없이 http://localhost:8080
에 연결하려고 시도합니다.
아마도이 프로젝트에 gwt-maven-plugin
을 사용하고 있으며, 이것이 tomcat 플러그인 구성을 방해 할 수 있는지 여부는 알 수 없습니다.