[ 
https://issues.apache.org/jira/browse/MTOMCAT-217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13630150#comment-13630150
 ] 

Petr Novak commented on MTOMCAT-217:
------------------------------------

Thanks for your comment.

I try to better explain my motivation and change the scenario to avoid use of 
server.xml, but there is still other problem.

In my scenario I want to build a self-executing JAR with PORT predefined to 
8042 and distribute it to my users, but users should still have the possibility 
to simply change the default port in their environment, when needed. 

I try this:

          <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <configuration>
              <port>8042</port>
            </configuration>
            <executions>
              <execution>
                <id>create-exec-war</id>
                <goals>
                  <goal>exec-war-only</goal>
                </goals>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>

No server.xml configuration, only PORT definition and I assumed that the port 
will be persisted in tomcat.standalone.properties as other parameters for 
exec.jar  and used as default for the execution, but not, the default 8080 was 
used instead. And if this will be possible, than should be also possible to use 
-httpPort=9090 to change the internal default value from build (serialized in  
tomcat.standalone.properties).

So I could avoid to define my own server.xml, but I need to have possibility to 
specify default values for all CLI parameters during maven-build time (in pom 
definition).


                
> CLI parameters passed to war-exec.jar don't override the internal values 
> (httpPort)
> -----------------------------------------------------------------------------------
>
>                 Key: MTOMCAT-217
>                 URL: https://issues.apache.org/jira/browse/MTOMCAT-217
>             Project: Apache Tomcat Maven Plugin
>          Issue Type: Bug
>          Components: tomcat7
>    Affects Versions: 2.2
>         Environment: Windows7, maven2.2.1, JDK-Oracle 7.0_u15
>            Reporter: Petr Novak
>            Assignee: Olivier Lamy (*$^¨%`£)
>
> I use maven-tomcat-plugin to create war-exec.jar with following definition:
>           <plugin>
>             <groupId>org.apache.tomcat.maven</groupId>
>             <artifactId>tomcat7-maven-plugin</artifactId>
>             <version>2.2-SNAPSHOT</version>
>             <configuration>
>               <serverXml>src/main/tomcat/server.xml</serverXml>
>             </configuration>
>             <executions>
>               <execution>
>                 <id>create-exec-war</id>
>                 <goals>
>                   <goal>exec-war-only</goal>
>                 </goals>
>                 <phase>package</phase>
>               </execution>
>             </executions>
>           </plugin>
> But when the server.xml is specified - to configure some defaults for server 
> like NIO, etc.  than the CLI parameters are ignored:
> java -jar war-exec.jar -httpPort 8888  
> does not change the the server port.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to