Details
Description
I am trying to start two containers, node 1 and node 2. Below are my settings from the debug messages
[DEBUG] Configuring mojo 'org.codehaus.cargo:cargo-maven2-plugin:0.3-SNAPSHOT:start' -->
[DEBUG] (s) home = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/tomcat5x/container
[DEBUG] (s) properties =
[DEBUG] (f) configuration = org.codehaus.cargo.maven2.Configuration@aefcbb
[DEBUG] (s) containerId = tomcat5x
[DEBUG] (s) url = http://apache.planetmirror.com.au/dist/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip
[DEBUG] (f) zipUrlInstaller = org.codehaus.cargo.maven2.ZipUrlInstaller@b5ad68
[DEBUG] (f) timeout = 120000
[DEBUG] (f) output = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/output-node1.log
[DEBUG] (s) log = c:\tony\CVS-builds\confluence\conf-acceptance-test\target\cargo-log-node1.log
[DEBUG] (s) systemProperties = {confluence.home=c:\tony\CVS-builds\confluence\conf-acceptance-test\target/confluence-home-node1}
[DEBUG] (f) container = org.codehaus.cargo.maven2.Container@19c4091
[DEBUG] (s) groupId = com.atlassian.confluence
[DEBUG] (s) artifactId = confluence-webapp
[DEBUG] (s) type = war
[DEBUG] (s) location = c:\tony\CVS-builds\confluence\conf-acceptance-test/../confluence/target/confluence.war
[DEBUG] (f) pingURL = http://localhost:12195/confluence
[DEBUG] (f) pingTimeout = 240000
[DEBUG] (f) deployables = [Lorg.codehaus.cargo.maven2.Deployable;@39060b
[DEBUG] (f) deployer = org.codehaus.cargo.maven2.Deployer@1bbd3e2
[DEBUG] (f) localRepository = [local] -> file://C:\Documents and Settings\Tony\.m2\repository
[DEBUG] (f) project = org.apache.maven.project.MavenProject@c524abf5
[DEBUG] (f) repositories = [[atlassian-m2-repository] -> http://repository.atlassian.com/maven2, [atlassian-m1-repository] -> http://repository.atlassian.c
om, [Codehaus] -> http://repository.codehaus.org/, [ibiblio] -> http://www.ibiblio.org/maven2, [Maven Snapshots] -> http://snapshots.maven.codehaus.org/maven
2/, [central] -> http://repo1.maven.org/maven2]
[DEBUG] (f) wait = false
[DEBUG] – end configuration –
[INFO] [cargo:start {execution: node1-container}]
[DEBUG] Configuring mojo 'org.codehaus.cargo:cargo-maven2-plugin:0.3-SNAPSHOT:deploy' -->
[DEBUG] (s) home = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/tomcat5x/container
[DEBUG] (s) properties = {cargo.jvmargs=-Djava.awt.headless=true -Xms256m -Xmx512m, cargo.servlet.port=12195}
[DEBUG] (f) configuration = org.codehaus.cargo.maven2.Configuration@1712193
[DEBUG] (s) containerId = tomcat5x
[DEBUG] (s) url = http://apache.planetmirror.com.au/dist/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip
[DEBUG] (f) zipUrlInstaller = org.codehaus.cargo.maven2.ZipUrlInstaller@537935
[DEBUG] (f) timeout = 120000
[DEBUG] (f) output = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/output-node1.log
[DEBUG] (s) log = c:\tony\CVS-builds\confluence\conf-acceptance-test\target\cargo-log-node1.log
[DEBUG] (s) systemProperties =
[DEBUG] (f) container = org.codehaus.cargo.maven2.Container@3aa791
[DEBUG] (s) groupId = com.atlassian.confluence
[DEBUG] (s) artifactId = confluence-webapp
[DEBUG] (s) type = war
[DEBUG] (s) location = c:\tony\CVS-builds\confluence\conf-acceptance-test/../confluence/target/confluence.war
[DEBUG] (f) pingURL = http://localhost:12195/confluence
[DEBUG] (f) pingTimeout = 240000
[DEBUG] (f) deployables = [Lorg.codehaus.cargo.maven2.Deployable;@cf3539
[DEBUG] (f) deployer = org.codehaus.cargo.maven2.Deployer@1af4309
[DEBUG] (f) localRepository = [local] -> file://C:\Documents and Settings\Tony\.m2\repository
[DEBUG] (f) project = org.apache.maven.project.MavenProject@c524abf5
[DEBUG] (f) repositories = [[atlassian-m2-repository] -> http://repository.atlassian.com/maven2, [atlassian-m1-repository] -> http://repository.atlassian.c
om, [Codehaus] -> http://repository.codehaus.org/, [ibiblio] -> http://www.ibiblio.org/maven2, [Maven Snapshots] -> http://snapshots.maven.codehaus.org/maven
2/, [central] -> http://repo1.maven.org/maven2]
[DEBUG] – end configuration –
[INFO] [cargo:deploy
]
[DEBUG] Configuring mojo 'org.codehaus.cargo:cargo-maven2-plugin:0.3-SNAPSHOT:start' -->
[DEBUG] (s) home = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/tomcat5x/container
[DEBUG] (s) properties =
[DEBUG] (f) configuration = org.codehaus.cargo.maven2.Configuration@f5b2e4
[DEBUG] (s) containerId = tomcat5x
[DEBUG] (s) url = http://apache.planetmirror.com.au/dist/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip
[DEBUG] (f) zipUrlInstaller = org.codehaus.cargo.maven2.ZipUrlInstaller@b3c24f
[DEBUG] (f) timeout = 120000
[DEBUG] (f) output = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/output-node2.log
[DEBUG] (s) log = c:\tony\CVS-builds\confluence\conf-acceptance-test\target\cargo-log-node2.log
[DEBUG] (s) systemProperties = {confluence.home=c:\tony\CVS-builds\confluence\conf-acceptance-test\target/confluence-home-node2}
[DEBUG] (f) container = org.codehaus.cargo.maven2.Container@dd89f9
[DEBUG] (s) groupId = com.atlassian.confluence
[DEBUG] (s) artifactId = confluence-webapp
[DEBUG] (s) type = war
[DEBUG] (s) location = c:\tony\CVS-builds\confluence\conf-acceptance-test/../confluence/target/confluence.war
[DEBUG] (f) pingURL = http://localhost:12197/confluence
[DEBUG] (f) pingTimeout = 240000
[DEBUG] (f) deployables = [Lorg.codehaus.cargo.maven2.Deployable;@8d5aad
[DEBUG] (f) deployer = org.codehaus.cargo.maven2.Deployer@3c35fd
[DEBUG] (f) localRepository = [local] -> file://C:\Documents and Settings\Tony\.m2\repository
[DEBUG] (f) project = org.apache.maven.project.MavenProject@c524abf5
[DEBUG] (f) repositories = [[atlassian-m2-repository] -> http://repository.atlassian.com/maven2, [atlassian-m1-repository] -> http://repository.atlassian.c
om, [Codehaus] -> http://repository.codehaus.org/, [ibiblio] -> http://www.ibiblio.org/maven2, [Maven Snapshots] -> http://snapshots.maven.codehaus.org/maven
2/, [central] -> http://repo1.maven.org/maven2]
[DEBUG] (f) wait = false
[DEBUG] – end configuration –
[INFO] [cargo:start {execution: node2-container}]
[DEBUG] Configuring mojo 'org.codehaus.cargo:cargo-maven2-plugin:0.3-SNAPSHOT:deploy' -->
[DEBUG] (s) home = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/tomcat5x/container
[DEBUG] (s) properties = {cargo.jvmargs=-Djava.awt.headless=true -Xms256m -Xmx512m, cargo.servlet.port=12197}
[DEBUG] (f) configuration = org.codehaus.cargo.maven2.Configuration@626fd2
[DEBUG] (s) containerId = tomcat5x
[DEBUG] (s) url = http://apache.planetmirror.com.au/dist/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip
[DEBUG] (f) zipUrlInstaller = org.codehaus.cargo.maven2.ZipUrlInstaller@9b777a
[DEBUG] (f) timeout = 120000
[DEBUG] (f) output = c:\tony\CVS-builds\confluence\conf-acceptance-test\target/output-node2.log
[DEBUG] (s) log = c:\tony\CVS-builds\confluence\conf-acceptance-test\target\cargo-log-node2.log
[DEBUG] (s) systemProperties =
[DEBUG] (f) container = org.codehaus.cargo.maven2.Container@c12978
[DEBUG] (s) groupId = com.atlassian.confluence
[DEBUG] (s) artifactId = confluence-webapp
[DEBUG] (s) type = war
[DEBUG] (s) location = c:\tony\CVS-builds\confluence\conf-acceptance-test/../confluence/target/confluence.war
[DEBUG] (f) pingURL = http://localhost:12197/confluence
[DEBUG] (f) pingTimeout = 240000
[DEBUG] (f) deployables = [Lorg.codehaus.cargo.maven2.Deployable;@189c12a
[DEBUG] (f) deployer = org.codehaus.cargo.maven2.Deployer@e8c7db
[DEBUG] (f) localRepository = [local] -> file://C:\Documents and Settings\Tony\.m2\repository
[DEBUG] (f) project = org.apache.maven.project.MavenProject@c524abf5
[DEBUG] (f) repositories = [[atlassian-m2-repository] -> http://repository.atlassian.com/maven2, [atlassian-m1-repository] -> http://repository.atlassian.c
om, [Codehaus] -> http://repository.codehaus.org/, [ibiblio] -> http://www.ibiblio.org/maven2, [Maven Snapshots] -> http://snapshots.maven.codehaus.org/maven
2/, [central] -> http://repo1.maven.org/maven2]
[DEBUG] – end configuration –
[INFO] [cargo:deploy
]
Node 1's container starts and deploys fine. Node 2 however gets this error in the output logs:
java.net.BindException: Address already in use: JVM_Bind:12195
Now this suggests that node 2 is using node 1's configuration! However, the debug messages suggest otherwise. Interestingly enough, node 2 does not produce its own output log - it uses node 1's output log and overwrites that.
The problem seems to lie in AbstractCargoMojo.createContainer(). using getPluginContext will retrieve the previous node settings. The maven 2 cargo plugin seems to create every subsequent container based on those settings.
I have attached a sample project to demonstrate the problem.