tante anni | 1 Feb 09:07
Picon
Favicon

RE: [MAVEN]"start" goal ignores configuration "run" works fine


Great! It is working!Thx for all your efforts. 

----------------------------------------
Date: Tue, 31 Jan 2012 20:47:18 +0100
From: nospam@...
To: user@...
Subject: Re: [cargo-user] [MAVEN]"start" goal ignores configuration "run" works fine

Hi Tante

I got it licked now: you're actually trying to set the <containerId> and
<containerUrl> for cargo:start. These are ONLY provided for cargo:run,
so that you can use the -Dcargo.maven.containerId and
-Dcargo.maven.containerUrl.

Anyhow, for cargo:start it is a bit more complex. You need to define as
follows:

      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.2.0</version>
        <!-- minimal configuration to let adb run (mvn package
org.codehaus.cargo:cargo-maven2-plugin:run) in a local tomcat -->
        <configuration>
          <container>
            <containerId>tomcat7x</containerId>
            <zipUrlInstaller>

(Continue reading)

Dreher, Markus | 1 Feb 09:08
Picon

Duplicate entries when merging wars

Hi all,

 

i’m trying to merge 2 wars with cargo-maven2-plugin 1.2.0.

Merging context-params works as expected, but for filter-mappings, mime-mappings, servlet-mappings and security-constraints there are duplicate entries in the resulting web.xml.

 

Each of the source web.xml contains an entry

 

  <mime-mapping>

    <extension>js</extension>

    <mime-type>application/x-javascript</mime-type>

  </mime-mapping>

 

And

 

  <filter-mapping>

    <filter-name>Trinidad Filter</filter-name>

    <url-pattern>*.jsf</url-pattern>

  </filter-mapping>

 

In the resulting web.xml there are 2 entries for mime-mapping and filter-mapping.

 

For servlet and filter elements this is not the case.

 

Can anybody give me a hint?

 

Thanks a lot.

 

Markus

40 Jahre DZBW

Herzlichen Dank unseren Kunden und Partnern. Wir freuen uns auf die gemeinsame Fortsetzung der konstruktiven, vertrauensvollen Zusammenarbeit.

Ihre Datenzentrale Baden-W

Julien Eluard | 1 Feb 16:10
Picon

Re: CARGO 1.2.0 now available!

Hi,


great news!

Could you elaborate CARGO-975
What does that mean for external container implementation?

Thanks,
Julien

2012/1/24 S. Ali Tokmen <nospam-E60e9lgXWaDl4B4owWWCMA@public.gmane.org>

Dear CARGO enthusiasts

First of all, happy New Year!

Since the last release of CARGO a bit more than one month and a half ago, we have had the opportunity of fixing some bugs and adding the functionalities:

  • CARGO Maven2/Maven3 plugin fixes and improvements:
    • ContainerStopMojo now can resolve dependencies with scope <test>, the same way ContainerRunMojo and ContainerStartMojo can (CARGO-1069 and CARGO-527).
    • The functional-tests artifact of the Separate Functional Test Module Archetype now uses packaging=jar and is compatible with m2e (CARGO-1065).
    • The CARGO plugin now resolves the required container JARs automatically (CARGO-975), meaning that if you're for example only using CARGO with the Jetty container than the other containers' JARs will not be downloaded.
  • Fixed a bug where the JSR-88 deployers' (used by the GlassFish remote deployer) undeploy method ignored the EAR's name ( CARGO-1076).
  • All CARGO JBoss containers, from the 10-year-old JBoss 3.x to the brand-new JBoss 7.1.x, now support datasources (CARGO-426). You can therefore now use CARGO to deploy datasources to any JBoss container; the bigger advantage being that the datasource definitions don't need to change between JBoss versions nor between all containers that CARGO can deploy datasources to.
  • The JOnAS remote deployer now works with Windows for XML deployment plans (CARGO-1067).
  • The Resin container has been improved:
  • Last but not least, the new XML replacement API introduced in CARGO 1.1.4, which avoids having CARGO-specific container configuration files in the distribution, is now used more extensively; as the Jetty (CARGO-1060), Resin (CARGO-1075) and Tomcat (CARGO-1061) container also make use of it.
    • This way, not only we won't have to maintain these CARGO-specific files manually anymore, but also new versions will be supported "out of the box" and CARGO will also work with different flavours of containers.

CARGO 1.2.0 is therefore now ready. Please note that on the API side, this new minor version comes with some behavioural changes and the removal of some elements (which have been deprecated for over 6 months now):

  • To achieve automatic resolution of container JARs in the Maven2/Maven3 container, a small change has been done in the ResourceUtils: it now loads resources using a class loader (as opposed to a class, which was the case in the past), hence AbstractLocalConfiguration.RESOURCE_PATH has been changed from "/org/codehaus/cargo/container/internal/resources/" to "org/codehaus/cargo/container/internal/resources/" (without the slash at the beginning). If your code uses the same constant, make sure you update it properly.
  • The Deployable.isExpanded* and AbstractCopyingInstalledLocalDeployer.setShouldDeployExpanded*s methods have been removed (CARGO-905 and CARGO-940). As a replacement:
    • The Deployable type has a generic isExpanded method.
    • AbstractCopyingInstalledLocalDeployer has a generic method setShouldDeployExpanded with two arguments.
  • File handling methods that manipulate texts now need to specify the encoding (CARGO-909).
  • In the Maven2/Maven3 plugin, the <zipUrlInstaller> and <artifactInstaller> don't have the <installDir> attribute anymore, replaced by <downloadDir> and <extractDir> attributes (CARGO-916).
  • TomcatPropertySet.MANAGER_URL (i.e. cargo.tomcat.manager.url) has been removed (CARGO-965), please use the generic RemotePropertySet.URI (i.e. cargo.remote.uri) instead.

You can access the full release notes by visiting https://jira.codehaus.org/secure/ReleaseNote.jspa?version=17088&styleName=Html&projectId=10730

To use this new version:

  • Users of the Java API and/or ANT tasks can download the CARGO uberjar and ANT tasks from the download page: http://cargo.codehaus.org/Downloads
  • Maven2/Maven3 users simply need to change the plugin's <version> to 1.2.0, and Maven2/Maven3 will download the new version automatically.

Please share your good (and bad) findings on the user <at> cargo.codehaus.org mailing list.

Enjoy!

-- S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com

S. Ali Tokmen | 1 Feb 19:33
Gravatar

Re: Duplicate entries when merging wars

Hi Markus

Did it use to work with any past version or is this your first attempt?

Thank you

S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com
On 2012/02/01 09:08, Dreher, Markus wrote:

Hi all,

 

i’m trying to merge 2 wars with cargo-maven2-plugin 1.2.0.

Merging context-params works as expected, but for filter-mappings, mime-mappings, servlet-mappings and security-constraints there are duplicate entries in the resulting web.xml.

 

Each of the source web.xml contains an entry

 

  <mime-mapping>

    <extension>js</extension>

    <mime-type>application/x-javascript</mime-type>

  </mime-mapping>

 

And

 

  <filter-mapping>

    <filter-name>Trinidad Filter</filter-name>

    <url-pattern>*.jsf</url-pattern>

  </filter-mapping>

 

In the resulting web.xml there are 2 entries for mime-mapping and filter-mapping.

 

For servlet and filter elements this is not the case.

 

Can anybody give me a hint?

 

Thanks a lot.

 

Markus

40 Jahre DZBW

Herzlichen Dank unseren Kunden und Partnern. Wir freuen uns auf die gemeinsame Fortsetzung der konstruktiven, vertrauensvollen Zusammenarbeit.

Ihre Datenzentrale Baden-Württemberg
_______________________________________________________________________________

Abonnieren Sie unseren Infobrief und erfahren Sie regelmäßig die neuesten Nachrichten über unsere Lösungen, aktuellen Projekte und Entwicklungen. Melden Sie sich an mit diesem Link http://www.datenzentrale.de/Info-Brief

_______________________________________________________________________________

Datenzentrale Baden-Württemberg, Anstalt des öffentlichen Rechts
Krailenshaldenstr. 44, 70469 Stuttgart
Telefon (0711) 8108-20, Telefax (0711) 8108-21350
E-Mail info-ug82gAI2klU@public.gmane.org, Internet www.datenzentrale.de
Vorstand: Karl Tramer (Vors.) und Joachim Kischlat, Vorsitzender des Verwaltungsrats: Gunter Czisch
USt-Id-Nr. DE147794223
_______________________________________________________________________________

S. Ali Tokmen | 1 Feb 19:38
Gravatar

Re: CARGO 1.2.0 now available!

Hi Julien

Here is how it now works:
  • When the CARGO Maven2/Maven3 plugin sees a containerId, say jetty7x, it takes out the end which matches \d+x; i.e. jetty7x becomes jetty. Let's name that part containerArtifact.
  • It then tries to resolve org.codehaus.cargo:cargo-core-container-<containerArtifact> that matches the plugin's version
  • If the resolving is successful, it creates a new ClassLoader with it.
  • If resolving fails, it prints out a message: Cannot resolve container artifact xxx for container yyy; but doesn't fail.
In your case, since the container's JAR is added as a plugin dependency, CARGO's mechanisms will simply not resolve anything and leave things as they are.

Let us know if it works correctly for you as well :)

Thank you

S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com
On 2012/02/01 16:10, Julien Eluard wrote:
Hi,

great news!

Could you elaborate CARGO-975
What does that mean for external container implementation?

Thanks,
Julien

2012/1/24 S. Ali Tokmen <nospam-E60e9lgXWaDl4B4owWWCMA@public.gmane.org>

Dear CARGO enthusiasts

First of all, happy New Year!

Since the last release of CARGO a bit more than one month and a half ago, we have had the opportunity of fixing some bugs and adding the functionalities:

  • CARGO Maven2/Maven3 plugin fixes and improvements:
    • ContainerStopMojo now can resolve dependencies with scope <test>, the same way ContainerRunMojo and ContainerStartMojo can (CARGO-1069 and CARGO-527).
    • The functional-tests artifact of the Separate Functional Test Module Archetype now uses packaging=jar and is compatible with m2e (CARGO-1065).
    • The CARGO plugin now resolves the required container JARs automatically (CARGO-975), meaning that if you're for example only using CARGO with the Jetty container than the other containers' JARs will not be downloaded.
  • Fixed a bug where the JSR-88 deployers' (used by the GlassFish remote deployer) undeploy method ignored the EAR's name ( CARGO-1076).
  • All CARGO JBoss containers, from the 10-year-old JBoss 3.x to the brand-new JBoss 7.1.x, now support datasources (CARGO-426). You can therefore now use CARGO to deploy datasources to any JBoss container; the bigger advantage being that the datasource definitions don't need to change between JBoss versions nor between all containers that CARGO can deploy datasources to.
  • The JOnAS remote deployer now works with Windows for XML deployment plans (CARGO-1067).
  • The Resin container has been improved:
  • Last but not least, the new XML replacement API introduced in CARGO 1.1.4, which avoids having CARGO-specific container configuration files in the distribution, is now used more extensively; as the Jetty (CARGO-1060), Resin (CARGO-1075) and Tomcat (CARGO-1061) container also make use of it.
    • This way, not only we won't have to maintain these CARGO-specific files manually anymore, but also new versions will be supported "out of the box" and CARGO will also work with different flavours of containers.

CARGO 1.2.0 is therefore now ready. Please note that on the API side, this new minor version comes with some behavioural changes and the removal of some elements (which have been deprecated for over 6 months now):

  • To achieve automatic resolution of container JARs in the Maven2/Maven3 container, a small change has been done in the ResourceUtils: it now loads resources using a class loader (as opposed to a class, which was the case in the past), hence AbstractLocalConfiguration.RESOURCE_PATH has been changed from "/org/codehaus/cargo/container/internal/resources/" to "org/codehaus/cargo/container/internal/resources/" (without the slash at the beginning). If your code uses the same constant, make sure you update it properly.
  • The Deployable.isExpanded* and AbstractCopyingInstalledLocalDeployer.setShouldDeployExpanded*s methods have been removed (CARGO-905 and CARGO-940). As a replacement:
    • The Deployable type has a generic isExpanded method.
    • AbstractCopyingInstalledLocalDeployer has a generic method setShouldDeployExpanded with two arguments.
  • File handling methods that manipulate texts now need to specify the encoding (CARGO-909).
  • In the Maven2/Maven3 plugin, the <zipUrlInstaller> and <artifactInstaller> don't have the <installDir> attribute anymore, replaced by <downloadDir> and <extractDir> attributes (CARGO-916).
  • TomcatPropertySet.MANAGER_URL (i.e. cargo.tomcat.manager.url) has been removed (CARGO-965), please use the generic RemotePropertySet.URI (i.e. cargo.remote.uri) instead.

You can access the full release notes by visiting https://jira.codehaus.org/secure/ReleaseNote.jspa?version=17088&styleName=Html&projectId=10730

To use this new version:

  • Users of the Java API and/or ANT tasks can download the CARGO uberjar and ANT tasks from the download page: http://cargo.codehaus.org/Downloads
  • Maven2/Maven3 users simply need to change the plugin's <version> to 1.2.0, and Maven2/Maven3 will download the new version automatically.

Please share your good (and bad) findings on the user-z8XaHfFCYGOxIXFVlbCvtR2eb7JE58TQ@public.gmane.org mailing list.

Enjoy!

-- S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com

Julien Eluard | 1 Feb 20:09
Picon

Re: CARGO 1.2.0 now available!

Seems like a neat idea.

Just tested with 1.2.0 and our plugin does work fine.
I do get a weird warning though during execution which seems harmless. I guess this is what you referred to.
Just for the record:

"""
[INFO] --- cargo-maven2-plugin:1.2.0:start (start-container) <at> embedded ---
Downloading: http://repo1.maven.org/maven2/org/codehaus/cargo/cargo-core-container-mule/1.2.0/cargo-core-container-mule-1.2.0.jar
[WARNING] [2.ContainerStartMojo] Cannot resolve container artifact org.codehaus.cargo:cargo-core-container-mule:jar:1.2.0 for container mule3x: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact org.codehaus.cargo:cargo-core-container-mule:jar:1.2.0 in central (http://repo1.maven.org/maven2)

Try downloading the file manually from the project website.

Then, install it using the command: 
    mvn install:install-file -DgroupId=org.codehaus.cargo -DartifactId=cargo-core-container-mule -Dversion=1.2.0 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: 
    mvn deploy:deploy-file -DgroupId=org.codehaus.cargo -DartifactId=cargo-core-container-mule -Dversion=1.2.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]


  org.codehaus.cargo:cargo-core-container-mule:jar:1.2.0

from the specified remote repositories:
  central (http://repo1.maven.org/maven2, releases=true, snapshots=false)
"""

Thanks for the good job (as usual)!
Julien

Le mercredi 1 février 2012 à 15:38, S. Ali Tokmen a écrit :

Hi Julien

Here is how it now works:
  • When the CARGO Maven2/Maven3 plugin sees a containerId, say jetty7x, it takes out the end which matches \d+x; i.e. jetty7x becomes jetty. Let's name that part containerArtifact.
  • It then tries to resolve org.codehaus.cargo:cargo-core-container-<containerArtifact> that matches the plugin's version
  • If the resolving is successful, it creates a new ClassLoader with it.
  • If resolving fails, it prints out a message: Cannot resolve container artifact xxx for container yyy; but doesn't fail.
In your case, since the container's JAR is added as a plugin dependency, CARGO's mechanisms will simply not resolve anything and leave things as they are.

Let us know if it works correctly for you as well :)

Thank you

S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com
On 2012/02/01 16:10, Julien Eluard wrote:
Hi,

great news!

Could you elaborate CARGO-975
What does that mean for external container implementation?

Thanks,
Julien

2012/1/24 S. Ali Tokmen <nospam <at> alishomepage.com>

Dear CARGO enthusiasts

First of all, happy New Year!

Since the last release of CARGO a bit more than one month and a half ago, we have had the opportunity of fixing some bugs and adding the functionalities:

  • CARGO Maven2/Maven3 plugin fixes and improvements:
    • ContainerStopMojo now can resolve dependencies with scope <test>, the same way ContainerRunMojo and ContainerStartMojo can (CARGO-1069 and CARGO-527).
    • The functional-tests artifact of the Separate Functional Test Module Archetype now uses packaging=jar and is compatible with m2e (CARGO-1065).
    • The CARGO plugin now resolves the required container JARs automatically (CARGO-975), meaning that if you're for example only using CARGO with the Jetty container than the other containers' JARs will not be downloaded.
  • Fixed a bug where the JSR-88 deployers' (used by the GlassFish remote deployer) undeploy method ignored the EAR's name ( CARGO-1076).
  • All CARGO JBoss containers, from the 10-year-old JBoss 3.x to the brand-new JBoss 7.1.x, now support datasources (CARGO-426). You can therefore now use CARGO to deploy datasources to any JBoss container; the bigger advantage being that the datasource definitions don't need to change between JBoss versions nor between all containers that CARGO can deploy datasources to.
  • The JOnAS remote deployer now works with Windows for XML deployment plans (CARGO-1067).
  • The Resin container has been improved:
  • Last but not least, the new XML replacement API introduced in CARGO 1.1.4, which avoids having CARGO-specific container configuration files in the distribution, is now used more extensively; as the Jetty (CARGO-1060), Resin (CARGO-1075) and Tomcat (CARGO-1061) container also make use of it.
    • This way, not only we won't have to maintain these CARGO-specific files manually anymore, but also new versions will be supported "out of the box" and CARGO will also work with different flavours of containers.

CARGO 1.2.0 is therefore now ready. Please note that on the API side, this new minor version comes with some behavioural changes and the removal of some elements (which have been deprecated for over 6 months now):

  • To achieve automatic resolution of container JARs in the Maven2/Maven3 container, a small change has been done in the ResourceUtils: it now loads resources using a class loader (as opposed to a class, which was the case in the past), hence AbstractLocalConfiguration.RESOURCE_PATH has been changed from "/org/codehaus/cargo/container/internal/resources/" to "org/codehaus/cargo/container/internal/resources/" (without the slash at the beginning). If your code uses the same constant, make sure you update it properly.
  • The Deployable.isExpanded* and AbstractCopyingInstalledLocalDeployer.setShouldDeployExpanded*s methods have been removed (CARGO-905 and CARGO-940). As a replacement:
    • The Deployable type has a generic isExpanded method.
    • AbstractCopyingInstalledLocalDeployer has a generic method setShouldDeployExpanded with two arguments.
  • File handling methods that manipulate texts now need to specify the encoding (CARGO-909).
  • In the Maven2/Maven3 plugin, the <zipUrlInstaller> and <artifactInstaller> don't have the <installDir> attribute anymore, replaced by <downloadDir> and <extractDir> attributes (CARGO-916).
  • TomcatPropertySet.MANAGER_URL (i.e. cargo.tomcat.manager.url) has been removed (CARGO-965), please use the generic RemotePropertySet.URI (i.e. cargo.remote.uri) instead.

You can access the full release notes by visiting https://jira.codehaus.org/secure/ReleaseNote.jspa?version=17088&styleName=Html&projectId=10730

To use this new version:

  • Users of the Java API and/or ANT tasks can download the CARGO uberjar and ANT tasks from the download page: http://cargo.codehaus.org/Downloads
  • Maven2/Maven3 users simply need to change the plugin's <version> to 1.2.0, and Maven2/Maven3 will download the new version automatically.

Please share your good (and bad) findings on the user <at> cargo.codehaus.org mailing list.

Enjoy!

-- S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com


S. Ali Tokmen | 1 Feb 22:02
Gravatar

Re: CARGO 1.2.0 now available!

Hi Julien

Maybe I'll set that warning as "debug" instead -it looks scary and is not very useful...

Cheers

S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com
On 2012/02/01 20:09, Julien Eluard wrote:
Seems like a neat idea.

Just tested with 1.2.0 and our plugin does work fine.
I do get a weird warning though during execution which seems harmless. I guess this is what you referred to.
Just for the record:

"""
[INFO] --- cargo-maven2-plugin:1.2.0:start (start-container) <at> embedded ---
[WARNING] [2.ContainerStartMojo] Cannot resolve container artifact org.codehaus.cargo:cargo-core-container-mule:jar:1.2.0 for container mule3x: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact org.codehaus.cargo:cargo-core-container-mule:jar:1.2.0 in central (http://repo1.maven.org/maven2)

Try downloading the file manually from the project website.

Then, install it using the command: 
    mvn install:install-file -DgroupId=org.codehaus.cargo -DartifactId=cargo-core-container-mule -Dversion=1.2.0 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: 
    mvn deploy:deploy-file -DgroupId=org.codehaus.cargo -DartifactId=cargo-core-container-mule -Dversion=1.2.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]


  org.codehaus.cargo:cargo-core-container-mule:jar:1.2.0

from the specified remote repositories:
  central (http://repo1.maven.org/maven2, releases=true, snapshots=false)
"""

Thanks for the good job (as usual)!
Julien

Le mercredi 1 février 2012 à 15:38, S. Ali Tokmen a écrit :

Hi Julien

Here is how it now works:
  • When the CARGO Maven2/Maven3 plugin sees a containerId, say jetty7x, it takes out the end which matches \d+x; i.e. jetty7x becomes jetty. Let's name that part containerArtifact.
  • It then tries to resolve org.codehaus.cargo:cargo-core-container-<containerArtifact> that matches the plugin's version
  • If the resolving is successful, it creates a new ClassLoader with it.
  • If resolving fails, it prints out a message: Cannot resolve container artifact xxx for container yyy; but doesn't fail.
In your case, since the container's JAR is added as a plugin dependency, CARGO's mechanisms will simply not resolve anything and leave things as they are.

Let us know if it works correctly for you as well :)

Thank you

S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com
On 2012/02/01 16:10, Julien Eluard wrote:
Hi,

great news!

Could you elaborate CARGO-975
What does that mean for external container implementation?

Thanks,
Julien

2012/1/24 S. Ali Tokmen <nospam-E60e9lgXWaDl4B4owWWCMA@public.gmane.org>

Dear CARGO enthusiasts

First of all, happy New Year!

Since the last release of CARGO a bit more than one month and a half ago, we have had the opportunity of fixing some bugs and adding the functionalities:

  • CARGO Maven2/Maven3 plugin fixes and improvements:
    • ContainerStopMojo now can resolve dependencies with scope <test>, the same way ContainerRunMojo and ContainerStartMojo can (CARGO-1069 and CARGO-527).
    • The functional-tests artifact of the Separate Functional Test Module Archetype now uses packaging=jar and is compatible with m2e (CARGO-1065).
    • The CARGO plugin now resolves the required container JARs automatically (CARGO-975), meaning that if you're for example only using CARGO with the Jetty container than the other containers' JARs will not be downloaded.
  • Fixed a bug where the JSR-88 deployers' (used by the GlassFish remote deployer) undeploy method ignored the EAR's name ( CARGO-1076).
  • All CARGO JBoss containers, from the 10-year-old JBoss 3.x to the brand-new JBoss 7.1.x, now support datasources (CARGO-426). You can therefore now use CARGO to deploy datasources to any JBoss container; the bigger advantage being that the datasource definitions don't need to change between JBoss versions nor between all containers that CARGO can deploy datasources to.
  • The JOnAS remote deployer now works with Windows for XML deployment plans (CARGO-1067).
  • The Resin container has been improved:
  • Last but not least, the new XML replacement API introduced in CARGO 1.1.4, which avoids having CARGO-specific container configuration files in the distribution, is now used more extensively; as the Jetty (CARGO-1060), Resin (CARGO-1075) and Tomcat (CARGO-1061) container also make use of it.
    • This way, not only we won't have to maintain these CARGO-specific files manually anymore, but also new versions will be supported "out of the box" and CARGO will also work with different flavours of containers.

CARGO 1.2.0 is therefore now ready. Please note that on the API side, this new minor version comes with some behavioural changes and the removal of some elements (which have been deprecated for over 6 months now):

  • To achieve automatic resolution of container JARs in the Maven2/Maven3 container, a small change has been done in the ResourceUtils: it now loads resources using a class loader (as opposed to a class, which was the case in the past), hence AbstractLocalConfiguration.RESOURCE_PATH has been changed from "/org/codehaus/cargo/container/internal/resources/" to "org/codehaus/cargo/container/internal/resources/" (without the slash at the beginning). If your code uses the same constant, make sure you update it properly.
  • The Deployable.isExpanded* and AbstractCopyingInstalledLocalDeployer.setShouldDeployExpanded*s methods have been removed (CARGO-905 and CARGO-940). As a replacement:
    • The Deployable type has a generic isExpanded method.
    • AbstractCopyingInstalledLocalDeployer has a generic method setShouldDeployExpanded with two arguments.
  • File handling methods that manipulate texts now need to specify the encoding (CARGO-909).
  • In the Maven2/Maven3 plugin, the <zipUrlInstaller> and <artifactInstaller> don't have the <installDir> attribute anymore, replaced by <downloadDir> and <extractDir> attributes (CARGO-916).
  • TomcatPropertySet.MANAGER_URL (i.e. cargo.tomcat.manager.url) has been removed (CARGO-965), please use the generic RemotePropertySet.URI (i.e. cargo.remote.uri) instead.

You can access the full release notes by visiting https://jira.codehaus.org/secure/ReleaseNote.jspa?version=17088&styleName=Html&projectId=10730

To use this new version:

  • Users of the Java API and/or ANT tasks can download the CARGO uberjar and ANT tasks from the download page: http://cargo.codehaus.org/Downloads
  • Maven2/Maven3 users simply need to change the plugin's <version> to 1.2.0, and Maven2/Maven3 will download the new version automatically.

Please share your good (and bad) findings on the user-z8XaHfFCYGOxIXFVlbCvtR2eb7JE58TQ@public.gmane.org mailing list.

Enjoy!

-- S. Ali Tokmen http://ali.tokmen.com/ GSM (ch): +41 79 207 29 22 [Swisscom] GSM (fr): +33 7 70 10 33 79 [Virgin Mobile] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com


mäce | 2 Feb 08:57
Picon

Re: Duplicate entries when merging wars


Hi Ali,

i tried version 1.0 before, but this was just because we had this dependency
in our project for starting and deploying to a jboss server.

With 1.0 there were other problems when merging the web.xml files (like
comma in a context-param value) so i gave the latest version a trie.

I tried it with 1.1.4 and the result is the same.

Btw. the ordering of the elements in Version 1.0 was nicer, in 1.1.4 and
1.2.0 the elements are mixed.

Thanks for your response

Markus 

S. Ali Tokmen wrote:
> 
> Hi Markus
> 
> Did it use to work with any past version or is this your first attempt?
> 
> Thank you
> 
> S. Ali Tokmen
> http://ali.tokmen.com/
> 
> GSM (ch): +41 79 207 29 22 [Swisscom]
> GSM (fr): +33 7 70 10 33 79 [Virgin Mobile]
> GSM (tr): +90 555 266 52 73 [Avea]
> 
> My AIM, ICQ, MSN Messenger and Yahoo IM
> contact details are on http://contact.ali.tokmen.com
> 
> 
> On 2012/02/01 09:08, Dreher, Markus wrote:
>>
>> Hi all,
>>
>>  
>>
>> i'm trying to merge 2 wars with cargo-maven2-plugin 1.2.0.
>>
>> Merging context-params works as expected, but for filter-mappings,
>> mime-mappings, servlet-mappings and security-constraints there are
>> duplicate entries in the resulting web.xml.
>>
>>  
>>
>> Each of the source web.xml contains an entry
>>
>>  
>>
>>   <mime-mapping>
>>
>>     <extension>js</extension>
>>
>>     <mime-type>application/x-javascript</mime-type>
>>
>>   </mime-mapping>
>>
>>  
>>
>> And
>>
>>  
>>
>>   <filter-mapping>
>>
>>     <filter-name>Trinidad Filter</filter-name>
>>
>>     <url-pattern>*.jsf</url-pattern>
>>
>>   </filter-mapping>
>>
>>  
>>
>> In the resulting web.xml there are 2 entries for mime-mapping and
>> filter-mapping.
>>
>>  
>>
>> For servlet and filter elements this is not the case.
>>
>>  
>>
>> Can anybody give me a hint?
>>
>>  
>>
>> Thanks a lot.
>>
>>  
>>
>> Markus
>>
>> *40 Jahre DZBW*
>>
>> Herzlichen Dank unseren Kunden und Partnern. Wir freuen uns auf die
>> gemeinsame Fortsetzung der konstruktiven, vertrauensvollen
>> Zusammenarbeit.
>>
>> Ihre Datenzentrale Baden-Württemberg
>> _______________________________________________________________________________
>>
>> Abonnieren Sie unseren Infobrief und erfahren Sie regelmäßig die
>> neuesten Nachrichten über unsere Lösungen, aktuellen Projekte und
>> Entwicklungen. Melden Sie sich an mit diesem Link
>> http://www.datenzentrale.de/Info-Brief
>>
>> _______________________________________________________________________________
>>
>> Datenzentrale Baden-Württemberg, Anstalt des öffentlichen Rechts
>> Krailenshaldenstr. 44, 70469 Stuttgart
>> Telefon (0711) 8108-20, Telefax (0711) 8108-21350
>> E-Mail info@... <mailto:info@...>, Internet
>> www.datenzentrale.de <http://www.datenzentrale.de>
>> Vorstand: Karl Tramer (Vors.) und Joachim Kischlat, Vorsitzender des
>> Verwaltungsrats: Gunter Czisch
>> USt-Id-Nr. DE147794223
>> _______________________________________________________________________________
>>
>> <#> 
> 
> 

--

-- 
View this message in context: http://old.nabble.com/Duplicate-entries-when-merging-wars-tp33241645p33248533.html
Sent from the Cargo - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

S. Ali Tokmen | 2 Feb 22:52
Gravatar

Re: Duplicate entries when merging wars

Hi Markus

Done, so I've opened two issues,
https://jira.codehaus.org/browse/CARGO-1078 and
https://jira.codehaus.org/browse/CARGO-1079

Both should be fixed now, please try again with version 1.2.1-SNAPSHOT.
Instructions for that can be found on:
http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots

Thank you

S. Ali Tokmen
http://ali.tokmen.com/

GSM (ch): +41 79 207 29 22 [Swisscom]
GSM (fr): +33 7 70 10 33 79 [Virgin Mobile]
GSM (tr): +90 555 266 52 73 [Avea]

My AIM, ICQ, MSN Messenger and Yahoo IM
contact details are on http://contact.ali.tokmen.com

On 2012/02/02 08:57, mäce wrote:
> Hi Ali,
>
> i tried version 1.0 before, but this was just because we had this dependency
> in our project for starting and deploying to a jboss server.
>
> With 1.0 there were other problems when merging the web.xml files (like
> comma in a context-param value) so i gave the latest version a trie.
>
> I tried it with 1.1.4 and the result is the same.
>
> Btw. the ordering of the elements in Version 1.0 was nicer, in 1.1.4 and
> 1.2.0 the elements are mixed.
>
> Thanks for your response
>
> Markus

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

mäce | 3 Feb 13:16
Picon

Re: Duplicate entries when merging wars


Hi Ali,

thanks for your quick response.

I tried the SNAPSHOT, but unfortunately it throws an exception (see trace).

As mentioned in my first post, the problem also occurs with servlet-mappings
and security-constraints,
eg:

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>resource</web-resource-name>
            <url-pattern>/myapp/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>myuser</role-name>
        </auth-constraint>
    </security-constraint>

and 

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>

Sorry for that.

[INFO] Merging exception creating UBERWAR

Embedded error: Exception merging web.xml files
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Merging exception
creating UBERWAR
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Merging exception
creating UBERWAR
        at
org.codehaus.cargo.maven2.UberWarMojo.execute(UberWarMojo.java:277)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by: org.codehaus.cargo.module.merge.MergeException: Exception merging
web.xml files
        at
org.codehaus.cargo.module.webapp.merge.WebXmlMerger.merge(WebXmlMerger.java:140)
        at
org.codehaus.cargo.module.webapp.merge.MergedWarArchive.getWebXml(MergedWarArchive.java:155)
        at
org.codehaus.cargo.module.webapp.merge.MergedWarArchive.merge(MergedWarArchive.java:219)
        at
org.codehaus.cargo.maven2.UberWarMojo.execute(UberWarMojo.java:249)
        ... 19 more
Caused by: java.lang.NullPointerException
        at
org.codehaus.cargo.module.webapp.elements.MimeMapping.getExtension(MimeMapping.java:47)
        at
org.codehaus.cargo.module.webapp.merge.WebXmlMerger.mergeMimeMappings(WebXmlMerger.java:344)
        at
org.codehaus.cargo.module.webapp.merge.WebXmlMerger.merge(WebXmlMerger.java:136)
        ... 22 more

Markus

S. Ali Tokmen wrote:
> 
> Hi Markus
> 
> Done, so I've opened two issues,
> https://jira.codehaus.org/browse/CARGO-1078 and
> https://jira.codehaus.org/browse/CARGO-1079
> 
> Both should be fixed now, please try again with version 1.2.1-SNAPSHOT.
> Instructions for that can be found on:
> http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots
> 
> Thank you
> 
> S. Ali Tokmen
> http://ali.tokmen.com/
> 
> GSM (ch): +41 79 207 29 22 [Swisscom]
> GSM (fr): +33 7 70 10 33 79 [Virgin Mobile]
> GSM (tr): +90 555 266 52 73 [Avea]
> 
> My AIM, ICQ, MSN Messenger and Yahoo IM
> contact details are on http://contact.ali.tokmen.com
> 
> 
> On 2012/02/02 08:57, mäce wrote:
>> Hi Ali,
>>
>> i tried version 1.0 before, but this was just because we had this
>> dependency
>> in our project for starting and deploying to a jboss server.
>>
>> With 1.0 there were other problems when merging the web.xml files (like
>> comma in a context-param value) so i gave the latest version a trie.
>>
>> I tried it with 1.1.4 and the result is the same.
>>
>> Btw. the ordering of the elements in Version 1.0 was nicer, in 1.1.4 and
>> 1.2.0 the elements are mixed.
>>
>> Thanks for your response
>>
>> Markus
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 

--

-- 
View this message in context: http://old.nabble.com/Duplicate-entries-when-merging-wars-tp33241645p33256398.html
Sent from the Cargo - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane