From cactus-dev-returnfhopkins@example.org Thu May 01 11:46:07 2008 Return-Path: <cactus-dev-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 69638 invoked from network); 1 May 2008 11:46:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2008 11:46:07 -0000 Received: (qmail 10976 invoked by uid 500); 1 May 2008 11:46:09 -0000 Delivered-To: fhopkins@example.org Received: (qmail 10925 invoked by uid 500); 1 May 2008 11:46:08 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:fhopkins@example.org> List-Help: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: "Cactus Developers List" <cactus-dev.jakarta.apache.org> Reply-To: "Cactus Developers List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 10914 invoked by uid 99); 1 May 2008 11:46:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 04:46:08 -0700 X-ASF-Spam-Status: No, hits=-1997.1 required=10.0 tests=ALL_TRUSTED,DATE_IN_PAST_03_06,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO vmgump.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 11:45:32 +0000 Received: from [83.161.120.155] (localhost [83.161.120.155]) by vmgump.apache.org (Postfix) with ESMTP id 9E84EAB4116 for <fhopkins@example.org>; Thu, 1 May 2008 00:31:18 -0700 (PDT) Date: Thu, 01 May 2008 00:31:18 PDT From: Petar Tahchiev <fhopkins@example.org> To: fhopkins@example.org Subject: [GUMP@vmgump]: Project cactus (in module jakarta-cactus) failed Message-Id: <fhopkins@example.org> X-Virus-Checked: Checked by ClamAV on apache.org To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at fhopkins@example.org. Project cactus has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 40 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - cactus : Cactus Framework Full details are available at: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Sole output [cactus.core.framework.uberjar.javaEE.14-1.8.0-SNAPSHOT.jar] identifier set to project name -DEBUG- (Gump generated) Maven2 Settings in: /srv/gump/public/workspace/jakarta-cactus/gump_mvn_settings.xml -INFO- Failed with reason build failed -DEBUG- Maven POM in: /srv/gump/public/workspace/jakarta-cactus/pom.xml -INFO- Failed to extract fallback artifacts from Gump Repository The following work was performed: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/gump_work/build_jakarta-cactus_cactus.html Work Name: build_jakarta-cactus_cactus (Type: Build) Work ended in a state of : Failed Elapsed: 3 mins 39 secs Command Line: mvn --settings /srv/gump/public/workspace/jakarta-cactus/gump_mvn_settings.xml install [Working Directory: /srv/gump/public/workspace/jakarta-cactus] CLASSPATH: /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar:/srv/gump/packages/junit3.8.1/junit.jar --------------------------------------------- [INFO] [remote-resources:process {execution: default}] [INFO] [site:attach-descriptor] [INFO] [rat:check {execution: default}] [INFO] Preparing checkstyle:check [INFO] [checkstyle:checkstyle] [INFO] Source directory does not exist - skipping report. [INFO] [checkstyle:check {execution: default}] [INFO] Unable to perform checkstyle:check, unable to find checkstyle:checkstyle outputFile. [INFO] [install:install] [INFO] Installing /srv/gump/public/workspace/jakarta-cactus/integration/pom.xml to /srv/gump/public/workspace/cactus.mvnlocalrepo/org/apache/cactus/cactus.integration/1.8.1-SNAPSHOT/cactus.integration-1.8.1-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] Building Cactus Shared API for the integration [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ Downloading: http://localhost:8192/maven2/ant/ant/1.6.5/ant-1.6.5.pom 764/764b 764b downloaded Downloading: http://localhost:8192/maven2/ant/ant/1.6.5/ant-1.6.5.jar 4/1009K 8/1009K 12/1009K 16/1009K 20/1009K 24/1009K 28/1009K 32/1009K 32/1009K 36/1009K 40/1009K 44/1009K 48/1009K 52/1009K 56/1009K 60/1009K 64/1009K 65/1009K 69/1009K 73/1009K 77/1009K 81/1009K 85/1009K 89/1009K 93/1009K 97/1009K 98/1009K 102/1009K 106/1009K 110/1009K 114/1009K 118/1009K 122/1009K 126/1009K 130/1009K 132/1009K 136/1009K 140/1009K 144/1009K 148/1009K 152/1009K 156/1009K 160/1009K 164/1009K 165/1009K 169/1009K 173/1009K 177/1009K 181/1009K 185/1009K 189/1009K 193/1009K 197/1009K 197/1009K 201/1009K 205/1009K 209/1009K 213/1009K 217/1009K 221/1009K 225/1009K 229/1009K 230/1009K 234/1009K 238/1009K 242/1009K 246/1009K 250/1009K 254/1009K 258/1009K 262/1009K 264/1009K 268/1009K 272/1009K 276/1009K 280/1009K 284/1009K 288/1009K 292/1009K 296/1009K 296/1009K 300/1009K 304/1009K 308/1009K 312/1009K 316/1009K 320/1009K 324/1009K 328/1009K 330/1009K 334/1009K 338/1009K 342/1009K 346/1009K 350/1009K 354/1009K 358/1009K 362/1009K 363/1009K 367/1009K 371/1009K 375/1009K 379/1009K 383/1009K 387/1009K 391/1009K 395/1009K 396/1009K 400/1009K 404/1009K 408/1009K 412/1009K 416/1009K 420/1009K 424/1009K 428/1009K 430/1009K 434/1009K 438/1009K 442/1009K 446/1009K 450/1009K 454/1009K 458/1009K 462/1009K 464/1009K 468/1009K 472/1009K 476/1009K 480/1009K 484/1009K 488/1009K 492/1009K 496/1009K 496/1009K 500/1009K 504/1009K 508/1009K 512/1009K 516/1009K 520/1009K 524/1009K 528/1009K 530/1009K 534/1009K 538/1009K 542/1009K 546/1009K 550/1009K 554/1009K 558/1009K 562/1009K 564/1009K 568/1009K 572/1009K 576/1009K 580/1009K 584/1009K 588/1009K 592/1009K 596/1009K 598/1009K 602/1009K 606/1009K 610/1009K 614/1009K 618/1009K 622/1009K 626/1009K 630/1009K 634/1009K 638/1009K 642/1009K 646/1009K 650/1009K 654/1009K 658/1009K 662/1009K 663/1009K 667/1009K 671/1009K 675/1009K 679/1009K 683/1009K 687/1009K 691/1009K 695/1009K 696/1009K 700/1009K 704/1009K 708/1009K 712/1009K 716/1009K 720/1009K 724/1009K 728/1009K 730/1009K 734/1009K 738/1009K 742/1009K 746/1009K 750/1009K 754/1009K 758/1009K 762/1009K 762/1009K 766/1009K 770/1009K 774/1009K 778/1009K 782/1009K 786/1009K 790/1009K 794/1009K 795/1009K 799/1009K 803/1009K 807/1009K 811/1009K 815/1009K 819/1009K 823/1009K 827/1009K 828/1009K 832/1009K 836/1009K 840/1009K 844/1009K 848/1009K 852/1009K 856/1009K 860/1009K 861/1009K 865/1009K 869/1009K 873/1009K 877/1009K 881/1009K 885/1009K 889/1009K 893/1009K 894/1009K 898/1009K 902/1009K 906/1009K 910/1009K 914/1009K 918/1009K 922/1009K 926/1009K 927/1009K 931/1009K 935/1009K 939/1009K 943/1009K 947/1009K 951/1009K 955/1009K 959/1009K 961/1009K 965/1009K 969/1009K 973/1009K 977/1009K 981/1009K 985/1009K 989/1009K 993/1009K 994/1009K 998/1009K 1002/1009K 1006/1009K 1009/1009K 1009K downloaded [INFO] [remote-resources:process {execution: default}] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Compiling 13 source files to /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/target/classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[28,51] package org.apache.cactus.integration.api.exception does not exist /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[402,42] cannot find symbol symbol : class CactusRuntimeException location: class org.apache.cactus.container.ContainerRunner /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[157,26] cannot find symbol symbol : class CactusRuntimeException location: class org.apache.cactus.container.ContainerRunner /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[410,22] cannot find symbol symbol : class CactusRuntimeException location: class org.apache.cactus.container.ContainerRunner [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 minutes 36 seconds [INFO] Finished at: Wed Apr 30 23:31:16 GMT-08:00 2008 [INFO] Final Memory: 29M/59M [INFO] ------------------------------------------------------------------------ --------------------------------------------- To subscribe to this information via syndicated feeds: - RSS: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/rss.xml - Atom: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/atom.xml ============================== Gump Tracking Only === Produced by Gump version 2.3. Gump Run 08000001052008, vmgump:vmgump-public:08000001052008 Gump E-mail Identifier (unique within run) #2. -- Apache Gump http://gump.apache.org/ [Instance: vmgump] --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From cactus-dev-returnfhopkins@example.org Sat May 03 11:30:06 2008 Return-Path: <cactus-dev-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 14666 invoked from network); 3 May 2008 11:30:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 May 2008 11:30:06 -0000 Received: (qmail 73672 invoked by uid 500); 3 May 2008 11:30:07 -0000 Delivered-To: fhopkins@example.org Received: (qmail 73621 invoked by uid 500); 3 May 2008 11:30:07 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:fhopkins@example.org> List-Help: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: "Cactus Developers List" <cactus-dev.jakarta.apache.org> Reply-To: "Cactus Developers List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 73610 invoked by uid 99); 3 May 2008 11:30:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 May 2008 04:30:07 -0700 X-ASF-Spam-Status: No, hits=-1997.1 required=10.0 tests=ALL_TRUSTED,DATE_IN_PAST_03_06,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO vmgump.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 May 2008 11:29:28 +0000 Received: from [83.161.120.155] (localhost [83.161.120.155]) by vmgump.apache.org (Postfix) with ESMTP id 9A820AB413B for <fhopkins@example.org>; Sat, 3 May 2008 00:12:13 -0700 (PDT) Date: Sat, 03 May 2008 00:12:13 PDT From: Petar Tahchiev <fhopkins@example.org> To: fhopkins@example.org Subject: [GUMP@vmgump]: Project cactus (in module jakarta-cactus) failed Message-Id: <fhopkins@example.org> X-Virus-Checked: Checked by ClamAV on apache.org To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at fhopkins@example.org. Project cactus has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 45 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - cactus : Cactus Framework Full details are available at: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Sole output [cactus.core.framework.uberjar.javaEE.14-1.8.0-SNAPSHOT.jar] identifier set to project name -DEBUG- (Gump generated) Maven2 Settings in: /srv/gump/public/workspace/jakarta-cactus/gump_mvn_settings.xml -INFO- Failed with reason build failed -DEBUG- Maven POM in: /srv/gump/public/workspace/jakarta-cactus/pom.xml -INFO- Failed to extract fallback artifacts from Gump Repository The following work was performed: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/gump_work/build_jakarta-cactus_cactus.html Work Name: build_jakarta-cactus_cactus (Type: Build) Work ended in a state of : Failed Elapsed: 3 mins 32 secs Command Line: mvn --settings /srv/gump/public/workspace/jakarta-cactus/gump_mvn_settings.xml install [Working Directory: /srv/gump/public/workspace/jakarta-cactus] CLASSPATH: /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar:/srv/gump/packages/junit3.8.1/junit.jar --------------------------------------------- [INFO] [remote-resources:process {execution: default}] [INFO] [site:attach-descriptor] [INFO] [rat:check {execution: default}] [INFO] Preparing checkstyle:check [INFO] [checkstyle:checkstyle] [INFO] Source directory does not exist - skipping report. [INFO] [checkstyle:check {execution: default}] [INFO] Unable to perform checkstyle:check, unable to find checkstyle:checkstyle outputFile. [INFO] [install:install] [INFO] Installing /srv/gump/public/workspace/jakarta-cactus/integration/pom.xml to /srv/gump/public/workspace/cactus.mvnlocalrepo/org/apache/cactus/cactus.integration/1.8.1-SNAPSHOT/cactus.integration-1.8.1-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] Building Cactus Shared API for the integration [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ Downloading: http://localhost:8192/maven2/ant/ant/1.6.5/ant-1.6.5.pom 764/764b 764b downloaded Downloading: http://localhost:8192/maven2/ant/ant/1.6.5/ant-1.6.5.jar 4/1009K 8/1009K 12/1009K 16/1009K 20/1009K 24/1009K 28/1009K 32/1009K 32/1009K 36/1009K 40/1009K 44/1009K 48/1009K 52/1009K 56/1009K 60/1009K 64/1009K 65/1009K 69/1009K 73/1009K 77/1009K 81/1009K 85/1009K 89/1009K 93/1009K 97/1009K 99/1009K 103/1009K 107/1009K 111/1009K 115/1009K 119/1009K 123/1009K 127/1009K 131/1009K 132/1009K 136/1009K 140/1009K 144/1009K 148/1009K 152/1009K 156/1009K 160/1009K 164/1009K 166/1009K 170/1009K 174/1009K 178/1009K 182/1009K 186/1009K 190/1009K 194/1009K 198/1009K 199/1009K 203/1009K 207/1009K 211/1009K 215/1009K 219/1009K 223/1009K 227/1009K 231/1009K 232/1009K 236/1009K 240/1009K 244/1009K 248/1009K 252/1009K 256/1009K 260/1009K 264/1009K 265/1009K 269/1009K 273/1009K 277/1009K 281/1009K 285/1009K 289/1009K 293/1009K 297/1009K 297/1009K 301/1009K 305/1009K 309/1009K 313/1009K 317/1009K 321/1009K 325/1009K 329/1009K 330/1009K 334/1009K 338/1009K 342/1009K 346/1009K 350/1009K 354/1009K 358/1009K 362/1009K 364/1009K 368/1009K 372/1009K 376/1009K 380/1009K 384/1009K 388/1009K 392/1009K 396/1009K 397/1009K 401/1009K 405/1009K 409/1009K 413/1009K 417/1009K 421/1009K 425/1009K 429/1009K 433/1009K 437/1009K 441/1009K 445/1009K 449/1009K 453/1009K 457/1009K 461/1009K 462/1009K 466/1009K 470/1009K 474/1009K 478/1009K 482/1009K 486/1009K 490/1009K 494/1009K 496/1009K 500/1009K 504/1009K 508/1009K 512/1009K 516/1009K 520/1009K 524/1009K 528/1009K 530/1009K 534/1009K 538/1009K 542/1009K 546/1009K 550/1009K 554/1009K 558/1009K 562/1009K 563/1009K 567/1009K 571/1009K 575/1009K 579/1009K 583/1009K 587/1009K 591/1009K 595/1009K 597/1009K 601/1009K 605/1009K 609/1009K 613/1009K 617/1009K 621/1009K 625/1009K 629/1009K 629/1009K 633/1009K 637/1009K 641/1009K 645/1009K 649/1009K 653/1009K 657/1009K 661/1009K 663/1009K 667/1009K 671/1009K 675/1009K 679/1009K 683/1009K 687/1009K 691/1009K 695/1009K 696/1009K 700/1009K 704/1009K 708/1009K 712/1009K 716/1009K 720/1009K 724/1009K 728/1009K 728/1009K 732/1009K 736/1009K 740/1009K 744/1009K 748/1009K 752/1009K 756/1009K 760/1009K 760/1009K 764/1009K 768/1009K 772/1009K 776/1009K 780/1009K 784/1009K 788/1009K 792/1009K 793/1009K 797/1009K 801/1009K 805/1009K 809/1009K 813/1009K 817/1009K 821/1009K 825/1009K 827/1009K 831/1009K 835/1009K 839/1009K 843/1009K 847/1009K 851/1009K 855/1009K 859/1009K 860/1009K 864/1009K 868/1009K 872/1009K 876/1009K 880/1009K 884/1009K 888/1009K 892/1009K 894/1009K 898/1009K 902/1009K 906/1009K 910/1009K 914/1009K 918/1009K 922/1009K 926/1009K 928/1009K 932/1009K 936/1009K 940/1009K 944/1009K 948/1009K 952/1009K 956/1009K 960/1009K 964/1009K 968/1009K 972/1009K 976/1009K 980/1009K 984/1009K 988/1009K 992/1009K 996/1009K 1000/1009K 1004/1009K 1008/1009K 1009/1009K 1009K downloaded [INFO] [remote-resources:process {execution: default}] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Compiling 13 source files to /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/target/classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[28,51] package org.apache.cactus.integration.api.exception does not exist /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[402,42] cannot find symbol symbol : class CactusRuntimeException location: class org.apache.cactus.container.ContainerRunner /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[157,26] cannot find symbol symbol : class CactusRuntimeException location: class org.apache.cactus.container.ContainerRunner /srv/gump/public/workspace/jakarta-cactus/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java:[410,22] cannot find symbol symbol : class CactusRuntimeException location: class org.apache.cactus.container.ContainerRunner [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 minutes 30 seconds [INFO] Finished at: Fri May 02 23:12:11 GMT-08:00 2008 [INFO] Final Memory: 31M/56M [INFO] ------------------------------------------------------------------------ --------------------------------------------- To subscribe to this information via syndicated feeds: - RSS: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/rss.xml - Atom: http://vmgump.apache.org/gump/public/jakarta-cactus/cactus/atom.xml ============================== Gump Tracking Only === Produced by Gump version 2.3. Gump Run 17000003052008, vmgump:vmgump-public:17000003052008 Gump E-mail Identifier (unique within run) #2. -- Apache Gump http://gump.apache.org/ [Instance: vmgump] --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From cactus-dev-returnfhopkins@example.org Sat May 03 12:05:32 2008 Return-Path: <cactus-dev-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 25050 invoked from network); 3 May 2008 12:05:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 May 2008 12:05:31 -0000 Received: (qmail 85992 invoked by uid 500); 3 May 2008 12:05:33 -0000 Delivered-To: fhopkins@example.org Received: (qmail 85961 invoked by uid 500); 3 May 2008 12:05:33 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:fhopkins@example.org> List-Help: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: "Cactus Developers List" <cactus-dev.jakarta.apache.org> Reply-To: "Cactus Developers List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 85950 invoked by uid 500); 3 May 2008 12:05:33 -0000 Received: (qmail 85947 invoked by uid 99); 3 May 2008 12:05:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 May 2008 05:05:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 May 2008 12:04:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9F8A6238898F; Sat, 3 May 2008 05:05:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r653060 - in /jakarta/cactus/trunk/cactus-site/src/site: site.xml xdoc/integration/maven2/ xdoc/integration/maven2/index.xml Date: Sat, 03 May 2008 12:05:01 -0000 To: fhopkins@example.org From: fhopkins@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <fhopkins@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ptahchiev Date: Sat May 3 05:05:01 2008 New Revision: 653060 URL: http://svn.apache.org/viewvc?rev=653060&view=rev Log: Added documentation on the Maven2 usage. Added: jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/ jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/index.xml (with props) Modified: jakarta/cactus/trunk/cactus-site/src/site/site.xml Modified: jakarta/cactus/trunk/cactus-site/src/site/site.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/cactus-site/src/site/site.xml?rev=653060&r1=653059&r2=653060&view=diff ============================================================================== --- jakarta/cactus/trunk/cactus-site/src/site/site.xml (original) +++ jakarta/cactus/trunk/cactus-site/src/site/site.xml Sat May 3 05:05:01 2008 @@ -30,7 +30,7 @@ <skin> <groupId>org.apache.cactus</groupId> <artifactId>cactus.maven.skin</artifactId> - <version>2.0.0</version> + <version>2.0.1-SNAPSHOT</version> </skin> <body> <breadcrumbs> @@ -91,6 +91,7 @@ <item name="Goals" href="integration/maven/goals.html"/> <item name="Properties" href="integration/maven/properties.html"/> </item> + <item name="Maven2" href="integration/maven2/index.html"/> <item name="Various IDEs" href="integration/howto_ide.html"/> <item name="JUnitEE" href="integration/howto_junitee.html"/> </item> Added: jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/index.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/index.xml?rev=653060&view=auto ============================================================================== --- jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/index.xml (added) +++ jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/index.xml Sat May 3 05:05:01 2008 @@ -0,0 +1,230 @@ +<?xml version="1.0"?> + +<!-- + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ======================================================================== +--> + +<document id="integration_maven2"> + + <properties> + <title>Maven2 Integration</title> + </properties> + + <body> + + <section name="Maven2 Integration"> + + <p> + Cactus provides a way to execute your tests with <a href="http://maven.apache.org/">Maven2</a>. + To execute the tests you can follow one of the approaches: + <ul> + <li> + either write a <code>build.xml</code>, and use the <a href="../ant/index.html">Ant integration</a>. + After that you call the <code>build.xml</code> through the <code>maven-antrun-plugin</code>. + </li> + <li> + The second approach would be to directly call the + <code>cargo-maven2-plugin</code> in order to start and stop the container. + </li> + </ul> + </p> + + </section> + + <section name="Using the first approach"> + <p> + This section describes how to execute your test-cases from Maven calling + the <code>build.xml</code> with the <code>maven-antrun-plugin</code>. + </p> + <p> + In your <code>pom.xml</code> add the following section: + </p> + <p> + <source> +<![CDATA[<plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <configuration> + <tasks> + <ant antfile="build.xml"/> + </tasks> + </configuration> + </execution> + </executions> +</plugin>]]></source> + </p> + <p> + For more information on how to use the maven-antrun-plugin see the official + webpage of the <a href="http://maven.apache.org/plugins/maven-antrun-plugin/">maven-antrun-plugin</a>. + </p> + <p> + After that see the <a href="../ant/index.html">cactus-ant-integration</a> section to configure your + <code>build.xml</code> file to cactify your war/ear and to execute your tests. Please note that this + approach is more like a hack, which makes it not so flexible. If you need to pass some properties to + the <code>build.xml</code> you can do it from the antrun configuration. Also in order to use the + maven-antrun plugin to execute your tests, you need to have <a href="http://ant.apache.org/">Ant</a> + installed and configured. + </p> + </section> + <section name="Second approach"> + <p> + This section desctibes the second approach to execute Cactus tests with Maven2. + </p> + <p> + From version 1.8.1 the Cactus project provides a maven2 plugin to help you manage + your cactus tests. There are several mojos you can use: <a href="cactifywar.html">cactifywar</a>, + <a href="cactifyear.html">cactiwyear</a> will help you to cactify your archives. + After the cactification process you can use the <code>cargo-maven2-plugin</code> + to start/stop the container and the <code>maven-surefire-plugin</code> to execute the + tests. + </p> + <p> + Here is a sample configuration of the build section of you <code>pom.xml</code>that would: + <ul> + <li>Cactify your war.</li> + <li>Start a container.</li> + <li>Deploy the cactified archive.</li> + <li>Execute the cactus-tests.</li> + <li>Stop the container.</li> + </ul> + </p> + <p> + <source> +<![CDATA[<build> + <plugins> + <plugin> + <groupId>org.apache.cactus</groupId> + <artifactId>cactus.integration.maven2</artifactId> + <version>1.8.1-SNAPSHOT</version> + <configuration> + <srcFile>ready.war</srcFile> + <destFile>cactifiedByMaven2.war</destFile> + </configuration> + <executions> + <execution> + <id>cactus-cactifywar</id> + <phase>pre-integration-test</phase> + <goals> + <goal>cactifywar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-maven2-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>start-container</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + </execution> + <execution> + <id>stop-container</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + <configuration> + <wait>false</wait> + <timeout>20000</timeout> + <container> + <containerId>tomcat5x</containerId> + <zipUrlInstaller> + <url>http://apache.speedbone.de/tomcat/tomcat-5/v5.5.25/bin/apache-tomcat-5.5.25.zip</url> + <installDir>${basedir}/install</installDir> + </zipUrlInstaller> + </container> + <configuration> + <deployables> + <deployable> + <groupId>org.apache.cactus</groupId> + <artifactId>cactus.samples.servlet</artifactId> + <type>war</type> + <properties> + <context>/test</context> + </properties> + <pingURL>http://localhost:8080/</pingURL> + </deployable> + </deployables> + </configuration> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + <executions> + <execution> + <id>surefire-it</id> + <phase>integration-test</phase> + <goals> + <goal>test</goal> + </goals> + <configuration> + <skip>false</skip> + <systemProperties> + <property> + <name>cactus.contextURL</name> + <value>http://localhost:8080/test/</value> + </property> + </systemProperties> + </configuration> + </execution> + </executions> + </plugin> + </plugins> +</build>]]> + </source> + What we do above is first define the <code>cactus.integration.maven2</code> plugin + in order to cactify the given war file. More on the <code>cactifywar</code> + mojo you can have a look at the configuration <a href="cactifywarmojo.html">page</a> for + this mojo. After that we attach <a href="http://cargo.codehaus.org/">Cargo's</a> + <code>cargo-maven2-plugin</code> to the <code>&lt;pre-integration-test&gt;</code> and the + <code>&lt;post-integration-test&gt;</code>. We configure the plugin to start, deploy the artifact + and stop the container. The last thing is to "unbind" the <code>maven-surefire-plugin</code> + from the <code>test</code> phase and bind it with the <code>integration-test</code> phase. + There are a few things to notice here: + <ul> + <li>First of all notice that since there is no <code>post-package</code> we are bound to attach + the <code>cactifywar</code> goal to the <code>pre-integration-test</code> phase. In + order to make it execute before the <code>start-container</code> execution we define it just before the + <code>start-container</code> exection.</li> + <li>Cargo needs a deployable to deploy in the container. This deployable is resolved from the + local maven repository (the one in <code>[USER_HOME]/.m2/repository/</code>). The cactifywar + mojo will install the cactified archive in the local maven repository only if the maven + <code>installInLocalRepo</code> parameter is set to <code>true</code>.</li> + <li>For the <code>maven-surefire-plugin</code> to execute cactus tests, there need to be a few + system properties set.<b>The <code>cactus.contextURL</code> property needs to be set!</b> The value + you have to set it, corresponds to the install url that you install your archives.</li> + <li></li> + </ul> + </p> + </section> + </body> +</document> Propchange: jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/index.xml ------------------------------------------------------------------------------ svn:eol-style = native --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From cactus-dev-returnfhopkins@example.org Sat May 03 12:42:58 2008 Return-Path: <cactus-dev-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 46001 invoked from network); 3 May 2008 12:42:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 May 2008 12:42:58 -0000 Received: (qmail 1462 invoked by uid 500); 3 May 2008 12:43:00 -0000 Delivered-To: fhopkins@example.org Received: (qmail 1436 invoked by uid 500); 3 May 2008 12:43:00 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:fhopkins@example.org> List-Help: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: "Cactus Developers List" <cactus-dev.jakarta.apache.org> Reply-To: "Cactus Developers List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 1425 invoked by uid 500); 3 May 2008 12:43:00 -0000 Received: (qmail 1422 invoked by uid 99); 3 May 2008 12:42:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 May 2008 05:42:59 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 May 2008 12:42:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6FDDD2388A35; Sat, 3 May 2008 05:42:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r653066 [3/3] - in /jakarta/cactus/trunk/integration: ./ ant/ ant/src/main/java/org/apache/cactus/integration/ant/ ant/src/test/java/org/apache/cactus/integration/ant/ ant/src/test/java/org/apache/cactus/integration/ant/deployment/ ant/src/... Date: Sat, 03 May 2008 12:42:30 -0000 To: fhopkins@example.org From: fhopkins@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <fhopkins@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java?rev=653066&view=auto ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java (added) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java Sat May 3 05:42:29 2008 @@ -0,0 +1,504 @@ +/* + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ======================================================================== + */ +package org.apache.cactus.maven2.mojos; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import org.apache.cactus.integration.api.cactify.CactifyUtils; +import org.apache.maven.archiver.MavenArchiveConfiguration; +import org.apache.maven.archiver.MavenArchiver; +import org.apache.maven.artifact.DependencyResolutionRequiredException; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.assembly.archive.ArchiveExpansionException; +import org.apache.maven.plugin.assembly.utils.AssemblyFileUtils; +import org.apache.maven.project.MavenProject; +import org.apache.tools.ant.types.XMLCatalog; +import org.codehaus.cargo.container.internal.util.ResourceUtils; +import org.codehaus.cargo.module.webapp.DefaultWarArchive; +import org.codehaus.cargo.module.webapp.EjbRef; +import org.codehaus.cargo.module.webapp.WarArchive; +import org.codehaus.cargo.module.webapp.WebXml; +import org.codehaus.cargo.module.webapp.WebXmlIo; +import org.codehaus.cargo.module.webapp.WebXmlUtils; +import org.codehaus.cargo.module.webapp.merge.WebXmlMerger; +import org.codehaus.plexus.archiver.ArchiverException; +import org.codehaus.plexus.archiver.jar.ManifestException; +import org.codehaus.plexus.archiver.manager.ArchiverManager; +import org.codehaus.plexus.archiver.manager.NoSuchArchiverException; +import org.codehaus.plexus.archiver.war.WarArchiver; +import org.codehaus.plexus.util.FileUtils; +import org.jdom.JDOMException; + +/** + * A maven2 mojo that injects elements necessary to run Cactus tests into an + * existing WAR file. + * + * @version $Id: CactifyWarMojo.java 394252 2008-04-29 04:20:17Z ptahchiev $ + * @goal cactifywar + * @requiresDependencyResolution compile + */ +public class CactifyWarMojo extends AbstractMojo +{ + + /** + * Get some non-crypto-grade randomness from various places. + */ + private static Random rand = new Random(System.currentTimeMillis() + + Runtime.getRuntime().freeMemory()); + + /** + * For resolving entities such as DTDs. + */ + private XMLCatalog xmlCatalog = null; + + /** + * The archive that contains the web-app that should be cactified. + * @parameter + */ + private File srcFile; + + /** + * The War archiver. + * + * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#war}" + * @required + */ + private WarArchiver warArchiver; + + /** + * The maven project. + * + * @parameter expression="${project}" + * @required + * @readonly + */ + private MavenProject project; + + /** + * The maven archive configuration to use. + * + * @parameter + */ + private MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); + + /** + * Location of the descriptor of which the content should be merged into + * the descriptor of the cactified archive. + * @parameter + */ + private File mergeWebXml; + + /** + * The Cactus test redirectors. + * @parameter + */ + private List redirectors = new ArrayList(); + + /** + * List of ejb-refs to add to the deployment descriptor + * of the cactified war. + */ + private List ejbRefs = new ArrayList(); + + /** + * The cargo ResourceUtils. + */ + private ResourceUtils utils = new ResourceUtils(); + + /** + * The archive manager. + * @component + */ + private ArchiverManager archiverManager; + + /** + * Dependencies to be included in the WEB-INF/lib folder. + * @parameter + */ + private List libDependencies; + + /** + * Should we install the cactified archive in the local maven repo? + * @parameter + */ + private boolean installLocally = false; + + /** + * @plexus.requirement + */ + private ArtifactFactory factory; + + /** + * The file that we want to produce. + * @parameter + */ + private File destFile; + + /** + * The "main" method of the mojo. + * @throws MojoExecutionException in case an error occurs. + * @throws MojoFailureException in case a failure occurs. + */ + public void execute() throws MojoExecutionException, MojoFailureException + { + + if(this.srcFile != null) + { + getLog().info("Analyzing war: " + this.srcFile.getAbsolutePath()); + } + + WebXml webXml = null; + + MavenArchiver archiver = new MavenArchiver(); + + archiver.setArchiver( warArchiver ); + + archiver.setOutputFile( destFile ); + + File tmpWebXml = null; + + try + { + webXml = getOriginalWebXml(); + tmpWebXml = cactifyWebXml(webXml); + + //Add the required libs for Cactus. + warArchiver.addLib(addJarWithClass("org.aspectj.lang.JoinPoint", + "AspectJ Runtime")); + warArchiver.addLib(addJarWithClass("org.apache.cactus." + + "ServletTestCase", "Cactus Framework")); + warArchiver.addLib(addJarWithClass("org.apache.commons.logging.Log", + "Commons-Logging")); + warArchiver.addLib(addJarWithClass("org.apache.commons." + + "httpclient.HttpClient", "Commons-HttpClient")); + warArchiver.addLib(addJarWithClass("junit.framework." + + "TestCase", "JUnit")); + + File tempLocation = createTempFile("cactus", "explode.tmp.dir", + getProject().getBasedir(), true); + + tempLocation.mkdirs(); + tempLocation.deleteOnExit(); + + //Now add all of the additional lib files. + for (Iterator iter = libDependencies.iterator();iter.hasNext();) + { + org.apache.cactus.maven2.mojos.Dependency dependency = + (org.apache.cactus.maven2.mojos.Dependency) iter.next(); + warArchiver.addLib(new File(dependency.getDependencyPath( + project, getLog()))); + } + + try { + AssemblyFileUtils.unpack( this.srcFile, tempLocation, + archiverManager ); + } catch (ArchiveExpansionException e) { + throw new MojoExecutionException("Error extracting the" + + " archive.", e); + } catch (NoSuchArchiverException e) { + throw new MojoExecutionException("Problem reading the " + + "source archive.", e); + } + warArchiver.addDirectory(tempLocation); + warArchiver.setWebxml(tmpWebXml); + archiver.createArchive( getProject(), getArchive() ); + + FileUtils.deleteDirectory(tempLocation); + } + catch (ArchiverException e) + { + throw new MojoExecutionException("Problem reading the " + + "source archive.", e); + } + catch (JDOMException e) + { + throw new MojoExecutionException("Unable to cactify " + + "your web.xml.", e); + } + catch (ManifestException e) + { + throw new MojoExecutionException("Problem reading the " + + "source archive.", e); + } + catch (IOException e) + { + throw new MojoExecutionException("Input/output error reading the" + + "source archive.", e); + } + catch (DependencyResolutionRequiredException e) + { + throw new MojoExecutionException("Error resolving your " + + "dependencies", e); + } + } + + /** + * Enhances the provided web deployment descriptor with the definitions + * required for testing with Cactus. + * + * @param theWebXml The original deployment descriptor + * @return A temporary file containing the cactified descriptor + * @throws JDOMException in case a JDOM exception is thrown. + * @throws MojoExecutionException in case any other error occurs. + */ + private File cactifyWebXml(WebXml theWebXml) throws JDOMException, + MojoExecutionException + { + CactifyUtils utils = new CactifyUtils(); + utils.addRedirectorDefinitions(theWebXml, redirectors); + addJspRedirector(); + addEjbRefs(theWebXml); + + // If the user has specified a deployment descriptor to merge into the + // cactified descriptor, perform the merge + if (this.mergeWebXml != null) + { + try + { + WebXml parsedMergeWebXml = WebXmlIo.parseWebXmlFromFile( + this.mergeWebXml, this.xmlCatalog); + WebXmlMerger merger = new WebXmlMerger(theWebXml); + merger.setLogger(utils.getLogger()); + + merger.merge(parsedMergeWebXml); + } + catch (IOException e) + { + throw new MojoExecutionException( + "Could not merge deployment descriptors", e); + } + } + + // Serialize the cactified deployment descriptor into a temporary file, + // so that it can get picked up by the War task + //FileUtils fileUtils = FileUtils.newFileUtils(); + File tmpDir = createTempFile("cactus", "tmp.dir", + getProject().getBasedir(), true); + tmpDir.mkdirs(); + tmpDir.deleteOnExit(); + File webXmlFile = null; + try + { + tmpDir.mkdir(); + File[] files = WebXmlIo.writeAll(theWebXml, + tmpDir.getAbsolutePath()); + List includes = new ArrayList(); + for (int i = 0; i < files.length; i++) + { + File f = files[i]; + f.deleteOnExit(); + if (f.getName().equals("web.xml")) + { + webXmlFile = f; + } + else + { + includes.add(f.getName()); + } + } + String[] strIncludes = new String[includes.size()]; + int i=0; + for(Iterator iter = includes.iterator(); iter.hasNext();) + { + strIncludes[i] = iter.next().toString(); + i++; + } + try { + warArchiver.addWebinf(tmpDir, strIncludes,null); + } catch (ArchiverException e) { + throw new MojoExecutionException( + "Error reading the source archive.", e); + } + } + catch (IOException ioe) + { + throw new MojoExecutionException( + "Could not write temporary deployment descriptor", ioe); + } + return webXmlFile; + } + + /** + * A method to create the temporary files. + * + * @param thePrefix the prefix of the filename. + * @param theSuffix the suffix of the filename + * @param theParentDir the parent directory + * @param isDeleteOnExit should we delete the directories on exit? + * @return the temporary file + */ + public File createTempFile(String thePrefix, String theSuffix, + File theParentDir, boolean isDeleteOnExit) + { + File result = null; + String parent = (theParentDir == null) + ? System.getProperty("java.io.tmpdir") + : theParentDir.getPath(); + + DecimalFormat fmt = new DecimalFormat("#####"); + synchronized (rand) + { + do + { + result = new File(parent, + thePrefix + fmt.format(Math.abs(rand.nextInt())) + + theSuffix); + } + while (result.exists()); + } + if (isDeleteOnExit) + { + result.deleteOnExit(); + } + return result; + } + + /** + * Adds the Cactus JSP redirector file to the web application. + */ + private void addJspRedirector() + { + // Now copy the actual JSP redirector file into the web application + File jspRedirectorFile = new File( + new File(System.getProperty("java.io.tmpdir")), + "jspRedirector.jsp"); + jspRedirectorFile.deleteOnExit(); + try + { + utils.copyResource("/org/apache/cactus/server/jspRedirector.jsp", + jspRedirectorFile); + } + catch (IOException e) + { + getLog().warn("Could not copy the JSP redirector (" + + e.getMessage() + ")"); + } + try { + warArchiver.addFile(jspRedirectorFile, jspRedirectorFile.getName()); + } catch (ArchiverException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * Adds the JAR file containing the specified resource to the WEB-INF/lib + * folder of a web-application archive. + * + * @param theClassName The name of the class that the JAR contains + * @param theDescription A description of the JAR that should be displayed + * to the user in log messages + */ + private File addJarWithClass(String theClassName, String theDescription) + { + String resourceName = "/" + theClassName.replace('.', '/') + ".class"; + if (srcFile != null) + { + try + { + WarArchive srcWar = new DefaultWarArchive( + new FileInputStream(srcFile)); + if (srcWar.containsClass(theClassName)) + { + getLog().debug("The " + theDescription + " JAR is " + + "already present in the WAR"); + return null; + } + } + catch (IOException ioe) + { + getLog().warn("Problem reading source WAR to when " + + "trying to detect already present JAR files (" + ioe + ")"); + } + } + File file = utils.getResourceLocation(resourceName); + return file; + } + + /** + * Extracts and parses the original web deployment descriptor from the + * web-app. + * + * @return The parsed descriptor or null if not found + * @throws MojoExecutionException If the descriptor could not be + * parsed + * @throws JDOMException in case is JDOM exception is thrown. + */ + private WebXml getOriginalWebXml() throws MojoExecutionException, + JDOMException + { + // Open the archive as JAR file and extract the deployment descriptor + WarArchive war = null; + try + { + war = new DefaultWarArchive(new FileInputStream(this.srcFile)); + WebXml webXml = war.getWebXml(); + return webXml; + } + catch (IOException e) + { + throw new MojoExecutionException("Failed to open WAR", e); + } + } + + /** + * Add ejb references to a web.xml. + * + * @param theWebXml the web.xml to modify + */ + private void addEjbRefs(WebXml theWebXml) + { + Iterator i = ejbRefs.iterator(); + while (i.hasNext()) + { + EjbRef ref = (EjbRef) i.next(); + WebXmlUtils.addEjbRef(theWebXml, ref); + } + } + + /** + * Getter method for the MavenProject. + * @return the MavenProject + */ + public MavenProject getProject() + { + return project; + } + + /** + * Getter method for the MavenArchiveConfiguration. + * @return the MavenArchiveConfiguration + */ + public MavenArchiveConfiguration getArchive() + { + return archive; + } +} \ No newline at end of file Propchange: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Added: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/Dependency.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/Dependency.java?rev=653066&view=auto ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/Dependency.java (added) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/Dependency.java Sat May 3 05:42:29 2008 @@ -0,0 +1,43 @@ +package org.apache.cactus.maven2.mojos; + +import java.io.File; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProject; + +/** + * + * Dependency that we use for the lib folder add-on's. + * + */ +public class Dependency +extends org.codehaus.cargo.maven2.configuration.Dependency +{ + public String getDependencyPath(MavenProject project, Log log) throws MojoExecutionException + { + String path = getLocation(); + + if (path == null) + { + if ((getGroupId() == null) || (getArtifactId() == null)) + { + throw new MojoExecutionException("You must specify a groupId/artifactId or " + + "a location that points to a directory or JAR"); + } + + // Default to jar if not type is specified + if (getType() == null) + { + setType("jar"); + } + + path = findArtifactLocation(project.getArtifacts(), log); + } + + log.debug("Classpath location = [" + new File(path).getPath() + "]"); + + return new File(path).getPath(); + } + +} Propchange: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/Dependency.java ------------------------------------------------------------------------------ svn:eol-style = native Added: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/EjbRef.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/EjbRef.java?rev=653066&view=auto ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/EjbRef.java (added) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/EjbRef.java Sat May 3 05:42:29 2008 @@ -0,0 +1,27 @@ +/* + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ======================================================================== + */ +package org.apache.cactus.maven2.mojos; +/** + * We extend the <code>org.codehaus.cargo.module.ejb.EjbDef</code> so that we + * can define custom ejbRefs in our <code>pom.xml</code>. + */ +public class EjbRef extends org.codehaus.cargo.module.ejb.EjbDef +{} Propchange: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/EjbRef.java ------------------------------------------------------------------------------ svn:eol-style = native Added: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/FilterRedirector.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/FilterRedirector.java?rev=653066&view=auto ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/FilterRedirector.java (added) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/FilterRedirector.java Sat May 3 05:42:29 2008 @@ -0,0 +1,29 @@ +/* + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ======================================================================== + */ +package org.apache.cactus.maven2.mojos; + +/** + * We extend the <code>FilterRedirector</code> so that we can define custom + * redirector definitions in the <code>pom.xml</code>. + */ +public class FilterRedirector +extends org.apache.cactus.integration.api.cactify.FilterRedirector +{} Propchange: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/FilterRedirector.java ------------------------------------------------------------------------------ svn:eol-style = native Added: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/JspRedirector.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/JspRedirector.java?rev=653066&view=auto ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/JspRedirector.java (added) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/JspRedirector.java Sat May 3 05:42:29 2008 @@ -0,0 +1,29 @@ +/* + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ======================================================================== + */ +package org.apache.cactus.maven2.mojos; + +/** + * We extend the <code>JspRedirector</code> so that we can define custom + * redirector definitions in the <code>pom.xml</code>. + */ +public class JspRedirector +extends org.apache.cactus.integration.api.cactify.JspRedirector +{} Propchange: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/JspRedirector.java ------------------------------------------------------------------------------ svn:eol-style = native Added: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/ServletRedirector.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/ServletRedirector.java?rev=653066&view=auto ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/ServletRedirector.java (added) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/ServletRedirector.java Sat May 3 05:42:29 2008 @@ -0,0 +1,28 @@ +/* + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ======================================================================== + */ +package org.apache.cactus.maven2.mojos; + +/** + * We extend the <code>ServletRedirector</code> so that we can define custom + * redirector definitions in the <code>pom.xml</code>. + */ +public class ServletRedirector +extends org.apache.cactus.integration.api.cactify.ServletRedirector {} Propchange: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/ServletRedirector.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: jakarta/cactus/trunk/integration/pom.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/pom.xml?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/pom.xml (original) +++ jakarta/cactus/trunk/integration/pom.xml Sat May 3 05:42:29 2008 @@ -31,6 +31,7 @@ <module>shared-api</module> <module>ant</module> <module>maven</module> + <module>maven2</module> <module>eclipse</module> </modules> <build> Modified: jakarta/cactus/trunk/integration/shared-api/pom.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/pom.xml?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/pom.xml (original) +++ jakarta/cactus/trunk/integration/shared-api/pom.xml Sat May 3 05:42:29 2008 @@ -39,6 +39,11 @@ <version>1.6.5</version> </dependency> <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.0</version> + </dependency> + <dependency> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-core-uberjar</artifactId> </dependency> Modified: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java (original) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/container/ContainerRunner.java Sat May 3 05:42:29 2008 @@ -25,7 +25,7 @@ import java.net.HttpURLConnection; import java.net.URL; -import org.apache.cactus.integration.api.exception.CactusRuntimeException; +import org.apache.cactus.integration.api.exceptions.CactusRuntimeException; import org.codehaus.cargo.util.log.Logger; /** Added: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/CactifyUtils.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/CactifyUtils.java?rev=653066&view=auto ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/CactifyUtils.java (added) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/CactifyUtils.java Sat May 3 05:42:29 2008 @@ -0,0 +1,121 @@ +package org.apache.cactus.integration.api.cactify; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.cargo.container.internal.util.ResourceUtils; +import org.codehaus.cargo.module.webapp.DefaultWarArchive; +import org.codehaus.cargo.module.webapp.WarArchive; +import org.codehaus.cargo.module.webapp.WebXml; +import org.codehaus.cargo.util.internal.log.AbstractLogger; + +/** + * Util class for cactifying purposes. + * @author tahchiev + */ +public class CactifyUtils { + + /** + * The cargo ResourceUtils. + */ + private ResourceUtils utils = new ResourceUtils(); + /** + * The abstract cargo logger used both by Ant and Maven2. + */ + private AbstractLogger logger; + + + /** + * Log debug the given message. + * @param msg + */ + public void debug(String msg) + { + getLogger().debug(msg, this.getClass().getName()); + } + /** + * Log info the given message. + * @param msg + */ + public void info(String msg) + { + getLogger().info(msg, this.getClass().getName()); + } + /** + * Log warn the given message. + * @param msg + */ + public void warn(String msg) + { + getLogger().warn(msg, this.getClass().getName()); + } + + /** + * Adds the definitions corresponding to the nested redirector elements to + * the provided deployment descriptor. + * + * @param theWebXml The deployment descriptor + */ + public void addRedirectorDefinitions(WebXml theWebXml, List redirectors) + { + boolean filterRedirectorDefined = false; + boolean jspRedirectorDefined = false; + boolean servletRedirectorDefined = false; + + // add the user defined redirectors + for (Iterator i = redirectors.iterator(); i.hasNext();) + { + + Redirector redirector = (Redirector) i.next(); + if (redirector instanceof FilterRedirector) + { + filterRedirectorDefined = true; + } + else if (redirector instanceof JspRedirector) + { + jspRedirectorDefined = true; + } + else if (redirector instanceof ServletRedirector) + { + servletRedirectorDefined = true; + } + redirector.mergeInto(theWebXml); + } + + // now add the default redirectors if they haven't been provided by + // the user + if (!filterRedirectorDefined) + { + new FilterRedirector(getLogger()) + .mergeInto(theWebXml); + } + if (!servletRedirectorDefined) + { + new ServletRedirector(getLogger()) + .mergeInto(theWebXml); + } + if (!jspRedirectorDefined) + { + new JspRedirector(getLogger()).mergeInto(theWebXml); + } + } + /** + * Getter method for the logger. + * @return AbstractLogger + */ + public AbstractLogger getLogger() { + return logger; + } + + /** + * Setter method for the logger. + * @param logger + */ + public void setLogger(AbstractLogger logger) { + this.logger = logger; + } + +} Propchange: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/CactifyUtils.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/FilterRedirector.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/FilterRedirector.java?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/FilterRedirector.java (original) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/FilterRedirector.java Sat May 3 05:42:29 2008 @@ -21,13 +21,16 @@ package org.apache.cactus.integration.api.cactify; import org.codehaus.cargo.module.webapp.WebXml; +import org.codehaus.cargo.module.webapp.WebXmlTag; +import org.codehaus.cargo.module.webapp.WebXmlUtils; import org.codehaus.cargo.module.webapp.WebXmlVersion; +import org.codehaus.cargo.module.webapp.elements.FilterMapping; import org.codehaus.cargo.util.log.Logger; /** * Implementation of <code>Redirector</code> for filter test redirectors. */ -public final class FilterRedirector extends Redirector +public class FilterRedirector extends Redirector { /** @@ -66,17 +69,50 @@ */ public void mergeInto(WebXml theWebXml) { + //If no version is specified then we accept the version is 2.2 + //and we don't add the filter redirector. + if(theWebXml.getVersion() == null) + return; if (WebXmlVersion.V2_3.compareTo(theWebXml.getVersion()) <= 0) { - if (theWebXml.getFilterNamesForClass - (FILTER_REDIRECTOR_CLASS).hasNext() && logger != null) + if (WebXmlUtils.getFilterNamesForClass + (theWebXml,FILTER_REDIRECTOR_CLASS).hasNext() && logger != null) { logger.warn("WARNING: Your web.xml already includes " + this.name + " mapping. Cactus is adding another one " + "which may prevent your container from starting.", "WARNING"); } - theWebXml.addFilter(this.name, FILTER_REDIRECTOR_CLASS); - theWebXml.addFilterMapping(this.name, this.mapping); + WebXmlUtils.addFilter(theWebXml, this.name, FILTER_REDIRECTOR_CLASS); + + +// WebXmlTag s = new WebXmlTag(theWebXml.getDescriptorType(), ""); + +// Iterator iter = WebXmlUtils.getFilterMappingElements(theWebXml, name); + + + //Element filterMappingElement = + // theWebXml.getDocument().createElement(WebXmlType.FILTER_MAPPING); + //filterMappingElement.appendChild(createNestedText(WebXmlTag.FILTER_NAME, filterName)); + //filterMappingElement.appendChild(createNestedText(WebXmlTag.URL_PATTERN, urlPattern)); + //addElement(WebXmlTag.FILTER_MAPPING, filterMappingElement, getRootElement()); + + + WebXmlTag tag = (WebXmlTag)theWebXml.getDescriptorType().getTagByName("filter-mapping"); + FilterMapping filterMapping = new FilterMapping(tag); + filterMapping.setName(this.name); + filterMapping.setUrlPattern(this.mapping); + filterMapping.setFilterName(this.name); + + + theWebXml.addTag(filterMapping); +// +// theWebXml.addTag(filterM); +// +// FilterMapping filterMapping = new FilterMapping(); + + + + WebXmlUtils.addFilterMapping(theWebXml, filterMapping); if (this.roles != null) { addSecurity(theWebXml); Modified: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/JspRedirector.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/JspRedirector.java?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/JspRedirector.java (original) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/JspRedirector.java Sat May 3 05:42:29 2008 @@ -21,12 +21,13 @@ package org.apache.cactus.integration.api.cactify; import org.codehaus.cargo.module.webapp.WebXml; +import org.codehaus.cargo.module.webapp.WebXmlUtils; import org.codehaus.cargo.util.log.Logger; /** * Implementation of <code>Redirector</code> for JSP test redirectors. */ -public final class JspRedirector extends Redirector +public class JspRedirector extends Redirector { /** * The default mapping of the Cactus JSP redirector. @@ -60,15 +61,15 @@ public void mergeInto(WebXml theWebXml) { //The iterator is never null - if (theWebXml.getServletNamesForJspFile - ("/jspRedirector.jsp").hasNext() && logger != null) + if (WebXmlUtils.getServletNamesForJspFile + (theWebXml, "/jspRedirector.jsp").hasNext() && logger != null) { logger.warn("WARNING: Your web.xml already includes " + this.name + " mapping. Cactus is adding another one " + "which may prevent your container from starting.", "WARNING"); } - theWebXml.addJspFile(this.name, "/jspRedirector.jsp"); - theWebXml.addServletMapping(this.name, this.mapping); + WebXmlUtils.addJspFile(theWebXml, this.name, "/jspRedirector.jsp"); + WebXmlUtils.addServletMapping(theWebXml, this.name, this.mapping); if (this.roles != null) { addSecurity(theWebXml); Modified: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/Redirector.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/Redirector.java?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/Redirector.java (original) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/Redirector.java Sat May 3 05:42:29 2008 @@ -25,6 +25,7 @@ import java.util.StringTokenizer; import org.codehaus.cargo.module.webapp.WebXml; +import org.codehaus.cargo.module.webapp.WebXmlUtils; import org.codehaus.cargo.util.log.Logger; /** @@ -132,21 +133,21 @@ while (tokenizer.hasMoreTokens()) { String role = tokenizer.nextToken().trim(); - if (!theWebXml.hasSecurityRole(role)) + if (!WebXmlUtils.hasSecurityRole(theWebXml,role)) { - theWebXml.addSecurityRole(role); + WebXmlUtils.addSecurityRole(theWebXml,role); } roles.add(role); } if (!roles.isEmpty()) { - if (!theWebXml.hasLoginConfig()) + if (!WebXmlUtils.hasLoginConfig(theWebXml)) { - theWebXml.setLoginConfig("BASIC", "myrealm"); + WebXmlUtils.setLoginConfig(theWebXml, "BASIC", "myrealm"); } - if (!theWebXml.hasSecurityConstraint(this.mapping)) + if (!WebXmlUtils.hasSecurityConstraint(theWebXml,this.mapping)) { - theWebXml.addSecurityConstraint("Cactus Test Redirector", + WebXmlUtils.addSecurityConstraint(theWebXml,"Cactus Test Redirector", this.mapping, roles); } } Modified: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/ServletRedirector.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/ServletRedirector.java?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/ServletRedirector.java (original) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/cactify/ServletRedirector.java Sat May 3 05:42:29 2008 @@ -21,12 +21,13 @@ package org.apache.cactus.integration.api.cactify; import org.codehaus.cargo.module.webapp.WebXml; +import org.codehaus.cargo.module.webapp.WebXmlUtils; import org.codehaus.cargo.util.log.Logger; /** * Implementation of <code>Redirector</code> for servlet test redirectors. */ -public final class ServletRedirector extends Redirector +public class ServletRedirector extends Redirector { /** @@ -64,15 +65,15 @@ */ public void mergeInto(WebXml theWebXml) { - if (theWebXml.getServletNamesForClass - (SERVLET_REDIRECTOR_CLASS).hasNext() && logger != null) + if (WebXmlUtils.getServletNamesForClass + (theWebXml, SERVLET_REDIRECTOR_CLASS).hasNext() && logger != null) { logger.warn("WARNING: Your web.xml already includes " + this.name + " mapping. Cactus is adding another one " + "which may prevent your container from starting.", "WARNING"); } - theWebXml.addServlet(this.name, SERVLET_REDIRECTOR_CLASS); - theWebXml.addServletMapping(this.name, this.mapping); + WebXmlUtils.addServlet(theWebXml, this.name, SERVLET_REDIRECTOR_CLASS); + WebXmlUtils.addServletMapping(theWebXml, this.name, this.mapping); if (this.roles != null) { addSecurity(theWebXml); Modified: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/EarParser.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/EarParser.java?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/EarParser.java (original) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/EarParser.java Sat May 3 05:42:29 2008 @@ -27,11 +27,12 @@ import javax.xml.parsers.ParserConfigurationException; -import org.apache.tools.ant.BuildException; +import org.apache.cactus.integration.api.exceptions.CactusRuntimeException; import org.codehaus.cargo.module.application.ApplicationXml; import org.codehaus.cargo.module.application.DefaultEarArchive; import org.codehaus.cargo.module.application.EarArchive; import org.codehaus.cargo.module.webapp.WarArchive; +import org.jdom.JDOMException; import org.xml.sax.SAXException; /** @@ -62,14 +63,14 @@ String webUri = getUriOfCactifiedWebModule(earArchive); if (webUri == null) { - throw new BuildException("Could not find cactified web " + throw new CactusRuntimeException("Could not find cactified web " + "module in the [" + theDeployableFile + "] EAR."); } WarArchive warArchive = earArchive.getWebModule(webUri); if (warArchive == null) { - throw new BuildException("Could not find the WAR [" + webUri + throw new CactusRuntimeException("Could not find the WAR [" + webUri + "] in the [" + theDeployableFile + "] EAR."); } @@ -87,17 +88,22 @@ } catch (IOException e) { - throw new BuildException("Failed to parse deployment descriptor " + throw new CactusRuntimeException("Failed to parse deployment descriptor " + "for EAR file [" + theDeployableFile + "].", e); } catch (ParserConfigurationException e) { - throw new BuildException("Failed to parse deployment descriptor " + throw new CactusRuntimeException("Failed to parse deployment descriptor " + "for EAR file [" + theDeployableFile + "].", e); } catch (SAXException e) { - throw new BuildException("Failed to parse deployment descriptor " + throw new CactusRuntimeException("Failed to parse deployment descriptor " + + "for EAR file [" + theDeployableFile + "].", e); + } + catch (JDOMException e) + { + throw new CactusRuntimeException("Failed to parse deployment descriptor " + "for EAR file [" + theDeployableFile + "].", e); } @@ -117,10 +123,11 @@ * be parsed * @throws ParserConfigurationException If there is an XML parser * configration problem + * @throws JDOMException */ protected static final String parseTestContext(EarArchive theEar, String theWebUri) - throws ParserConfigurationException, IOException, SAXException + throws ParserConfigurationException, IOException, SAXException, JDOMException { String context = theEar.getApplicationXml() .getWebModuleContextRoot(theWebUri); @@ -128,7 +135,7 @@ { // The application.xml does not define a <context-root> element. // This is wrong! - throw new BuildException("Your application.xml must define a " + throw new CactusRuntimeException("Your application.xml must define a " + "<context-root> element in the <web> module definition."); } @@ -157,9 +164,10 @@ * be parsed * @throws ParserConfigurationException If there is an XML parser * configration problem + * @throws JDOMException */ protected static final String getUriOfCactifiedWebModule(EarArchive theEar) - throws SAXException, IOException, ParserConfigurationException + throws SAXException, IOException, ParserConfigurationException, JDOMException { ApplicationXml applicationXml = theEar.getApplicationXml(); for (Iterator i = applicationXml.getWebModuleUris(); i.hasNext();) Modified: jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/WarParser.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/WarParser.java?rev=653066&r1=653065&r2=653066&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/WarParser.java (original) +++ jakarta/cactus/trunk/integration/shared-api/src/main/java/org/apache/cactus/integration/api/deployable/WarParser.java Sat May 3 05:42:29 2008 @@ -27,9 +27,11 @@ import javax.xml.parsers.ParserConfigurationException; -import org.apache.tools.ant.BuildException; +import org.apache.cactus.integration.api.exceptions.CactusRuntimeException; import org.codehaus.cargo.module.webapp.DefaultWarArchive; import org.codehaus.cargo.module.webapp.WarArchive; +import org.codehaus.cargo.module.webapp.WebXmlUtils; +import org.jdom.JDOMException; import org.xml.sax.SAXException; /** @@ -66,17 +68,22 @@ } catch (IOException e) { - throw new BuildException("Failed to parse deployment descriptor " + throw new CactusRuntimeException("Failed to parse deployment descriptor " + "for WAR file [" + theDeployableFile + "].", e); } catch (ParserConfigurationException e) { - throw new BuildException("Failed to parse deployment descriptor " + throw new CactusRuntimeException("Failed to parse deployment descriptor " + "for WAR file [" + theDeployableFile + "].", e); } catch (SAXException e) { - throw new BuildException("Failed to parse deployment descriptor " + throw new CactusRuntimeException("Failed to parse deployment descriptor " + + "for WAR file [" + theDeployableFile + "].", e); + } + catch (JDOMException e) + { + throw new CactusRuntimeException("Failed to parse deployment descriptor " + "for WAR file [" + theDeployableFile + "].", e); } @@ -113,18 +120,19 @@ * be parsed * @throws ParserConfigurationException If there is an XML parser * configration problem + * @throws JDOMException */ static String parseServletRedirectorMapping(WarArchive theWar) - throws SAXException, IOException, ParserConfigurationException + throws SAXException, IOException, ParserConfigurationException, JDOMException { - Iterator servletNames = theWar.getWebXml().getServletNamesForClass( + Iterator servletNames = WebXmlUtils.getServletNamesForClass(theWar.getWebXml(), "org.apache.cactus.server.ServletTestRedirector"); if (servletNames.hasNext()) { // we iterate over all of the servlet names but return the first met only --//TODO to be fixed while(servletNames.hasNext()) { String name = (String) servletNames.next(); - Iterator mappings = theWar.getWebXml().getServletMappings(name); + Iterator mappings = WebXmlUtils.getServletMappings(theWar.getWebXml(), name); if (mappings.hasNext()) { return (String) mappings.next(); @@ -148,17 +156,18 @@ * be parsed * @throws ParserConfigurationException If there is an XML parser * configration problem + * @throws JDOMException */ static String parseFilterRedirectorMapping(WarArchive theWar) - throws IOException, SAXException, ParserConfigurationException + throws IOException, SAXException, ParserConfigurationException, JDOMException { - Iterator filterNames = theWar.getWebXml().getFilterNamesForClass( + Iterator filterNames = WebXmlUtils.getFilterNamesForClass(theWar.getWebXml(), "org.apache.cactus.server.FilterTestRedirector"); if (filterNames.hasNext()) { // we only care about the first definition and the first mapping String name = (String) filterNames.next(); - Iterator mappings = theWar.getWebXml().getFilterMappings(name); + Iterator mappings = WebXmlUtils.getFilterMappings(theWar.getWebXml(), name); if (mappings.hasNext()) { return (String) mappings.next(); @@ -181,9 +190,10 @@ * be parsed * @throws ParserConfigurationException If there is an XML parser * configration problem + * @throws JDOMException */ static String parseJspRedirectorMapping(WarArchive theWar) - throws IOException, SAXException, ParserConfigurationException + throws IOException, SAXException, ParserConfigurationException, JDOMException { // To get the JSP redirector mapping, we must first get the full path to // the corresponding JSP file in the WAR @@ -191,7 +201,7 @@ if (jspRedirectorPath != null) { jspRedirectorPath
{'source': 'Apache Software Foundation Public Mail Archives'}