Hello Cargo Team - Salutations,
Thanks for the outstanding plugin to make life easy for me.
Coming to my issue: I have the below setup that works fine, where I have configued most of it:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<version>1.10.15</version>
<configuration>
<deployables>
<deployable>
<location>${project.build.directory}/${project.build.finalName}.war</location>
<properties>
<context>/MyService</context>
</properties>
</deployable>
</deployables>
<container>
<containerId>tomcat9x</containerId>
<home>${project.basedir}/src/test/resources/local/apache-tomcat</home>
<type>installed</type>
<timeout>300000</timeout>
</container>
<configuration>
<properties>
<cargo.jvmargs>
-Xms1024m -Xmx2048m
-- add-opens java.base/
java.io=ALL-UNNAMED
-- add-opens java.base/
java.net=ALL-UNNAMED
-- add-opens java.base/java.nio=ALL-UNNAMED
-- add-opens java.base/java.util=ALL-UNNAMED
-- add-opens java.base/java.lang=ALL-UNNAMED
-- add-opens java.base/java.time=ALL-UNNAMED
-- add-opens java.base/java.math=ALL-UNNAMED
-- add-opens java.base/sun.util.calendar=ALL-UNNAMED
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=
127.0.0.1:5005 -cp ${project.basedir}/src/test/resources/local/
-DConfigFile=${project.basedir}/src/test/resources/local/MyService.cfg
</cargo.jvmargs>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.shutdown.port>8205</cargo.tomcat.shutdown.port>
<cargo.servlet.users>myuser1:mypass1:tomcat,myrole|myuser2:mypass2:tomcat,myrole|myuser3:mypass3:tomcat,myrole|</cargo.servlet.users>
</properties>
</configuration>
</configuration>
</plugin>
With the above, I can run my webapp locally.
But for one issue.
In my web.xml I need this for my local to run, and not when deployed onto our environment box:
<!-- For Dev Only Authentication
<security-constraint>
<web-resource-collection>
<web-resource-name>protected-area</web-resource-name>
<url-pattern>/*< /url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>myrole</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>myrealm</realm-name>
</login-config>
<security-role>
<description>The CFO Users</description>
<role-name>myrole</role-name>
</security-role> -->
So everytime I checkout my git branch, I uncomment this in my web.xml to do my local testing and revert this back before I commit/push my dev changes.
<!-- For Dev Only Authentication -->
<security-constraint>
<web-resource-collection>
<web-resource-name>protected-area</web-resource-name>
<url-pattern>/*< /url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>myrole</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>myrealm</realm-name>
</login-config>
<security-role>
<description>The CFO Users</description>
<role-name>myrole</role-name>
</security-role>
I tried using this:
<cargo.servlet.webxml>${project.basedir}/src/test/resources/local/web.xml</cargo.servlet.webxml>
But it never worked for me.
Any direction here.
Thanks,
Abdul