Changes for page Maven Kicking the tyres without changing your project structure
Last modified by Henrique Prange on 2015/09/11 17:57
From version 22.1
edited by Lachlan Deck
on 2008/06/24 00:39
on 2008/06/24 00:39
Change comment:
Add tip to hang in there with longish guide.
To version 21.1
edited by Lachlan Deck
on 2008/07/02 23:41
on 2008/07/02 23:41
Change comment:
Adding example for building WOApplications
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -203,7 +203,7 @@ 203 203 204 204 === Repositories === 205 205 206 -So far we have assumed that maven just knows where to find third party libraries. There is the default local repository (e.g., ,,/.m2/repository) and a remote one at ibiblio.org or a mirror of the same. See [[http://maven.apache.org/guides/introduction/introduction-to-repositories.html]].,,206 +So far we have assumed that maven just knows where to find third party libraries. There is the default local repository (e.g., /.m2/repository) and a remote one at ibiblio.org or a mirror of the same. See [[http://maven.apache.org/guides/introduction/introduction-to-repositories.html]]. 207 207 208 208 {{noformat}} 209 209 ... ... @@ -278,8 +278,10 @@ 278 278 279 279 === Packaging Frameworks as Jars === 280 280 281 -Here's the definition for /frameworks/pom.xml. 281 +Here's the definition for /frameworks/pom.xml. Note that it depends on the following Info.plist file being located under trunk/frameworks/src/main/resources: 282 282 283 +{{attachments patterns="Info.plist" upload="false"}}{{/attachments}} 284 + 283 283 {{code title="/frameworks/pom.xml"}} 284 284 285 285 <?xml version="1.0" encoding="UTF-8"?> ... ... @@ -289,7 +289,7 @@ 289 289 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 290 290 291 291 <modelVersion>4.0.0</modelVersion> 292 - 294 + 293 293 <!-- parent artifact --> 294 294 <parent> 295 295 <artifactId>mywostuff</artifactId> ... ... @@ -301,7 +301,7 @@ 301 301 <artifactId>frameworks</artifactId> 302 302 <groupId>com.mywostuff</groupId> 303 303 <packaging>pom</packaging> 304 - 306 + 305 305 <!-- framework relevant properties --> 306 306 <properties> 307 307 <!-- NS related properties fills in Info.plist etc--> ... ... @@ -441,7 +441,7 @@ 441 441 <!-- artifact identity --> 442 442 <artifactId>CustomBusinessLogic</artifactId> 443 443 <groupId>com.mywostuff.frameworks</groupId> 444 - 446 + 445 445 <!-- specific dependencies --> 446 446 <dependencies> 447 447 <dependency> ... ... @@ -455,8 +455,231 @@ 455 455 456 456 === Packaging Applications === 457 457 458 -details to co me...460 +Here's the definition for /apps/pom.xml which is shared by any sub-modules (i.e., ApplicationA and ApplicationB). 459 459 462 +{{code title="/apps/pom.xml"}} 463 + 464 +<?xml version="1.0" encoding="UTF-8"?> 465 +<project xmlns="http://maven.apache.org/POM/4.0.0" 466 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 467 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 468 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> 469 + 470 + <modelVersion>4.0.0</modelVersion> 471 + 472 + <!-- parent artifact --> 473 + <parent> 474 + <groupId>com</groupId> 475 + <artifactId>mywostuff</artifactId> 476 + <version>1.0-SNAPSHOT</version> 477 + </parent> 478 + 479 + <!-- artifact identity --> 480 + <artifactId>apps</artifactId> 481 + <groupId>com.mywostuff</groupId> 482 + <packaging>pom</packaging> 483 + 484 + <!-- modules --> 485 + <modules> 486 + <module>ApplicationA</module> 487 + <module>ApplicationB</module> 488 + </modules> 489 + 490 + <!-- specific dependencies (for modules) --> 491 + <dependencies> 492 + <!-- wonder frameworks --> 493 + <dependency> 494 + <artifactId>ERExtensions</artifactId> 495 + <groupId>${wonder.common.groupId}</groupId> 496 + </dependency> 497 + <dependency> 498 + <artifactId>JavaWOExtensions</artifactId> 499 + <groupId>${wonder.common.groupId}</groupId> 500 + </dependency> 501 + 502 + <!-- project libs --> 503 + <dependency> 504 + <artifactId>CustomExtensions</artifactId> 505 + <groupId>${my.frameworks.groupId}</groupId> 506 + </dependency> 507 + <dependency> 508 + <artifactId>CustomBusinessLogic</artifactId> 509 + <groupId>${my.frameworks.groupId}</groupId> 510 + </dependency> 511 + 512 + <!-- webobjects dependencies --> 513 + <dependency> 514 + <artifactId>JavaFoundation</artifactId> 515 + <groupId>${webobjects.groupId}</groupId> 516 + </dependency> 517 + <dependency> 518 + <artifactId>JavaJDBCAdaptor</artifactId> 519 + <groupId>${webobjects.groupId}</groupId> 520 + </dependency> 521 + <dependency> 522 + <artifactId>JavaWebObjects</artifactId> 523 + <groupId>${webobjects.groupId}</groupId> 524 + </dependency> 525 + <dependency> 526 + <artifactId>JavaEOControl</artifactId> 527 + <groupId>${webobjects.groupId}</groupId> 528 + </dependency> 529 + <dependency> 530 + <artifactId>JavaEOAccess</artifactId> 531 + <groupId>${webobjects.groupId}</groupId> 532 + </dependency> 533 + <dependency> 534 + <artifactId>JavaWebObjects</artifactId> 535 + <groupId>${webobjects.groupId}</groupId> 536 + </dependency> 537 + <dependency> 538 + <artifactId>JavaXML</artifactId> 539 + <groupId>${webobjects.groupId}</groupId> 540 + </dependency> 541 + </dependencies> 542 + 543 + <!-- build config (for modules) --> 544 + <build> 545 + <sourceDirectory>src</sourceDirectory> 546 + <testSourceDirectory>tests</testSourceDirectory> 547 + <resources> 548 + <resource> 549 + <targetPath>Resources</targetPath> 550 + <filtering>false</filtering> 551 + <directory>Components</directory> 552 + </resource> 553 + <resource> 554 + <targetPath>Resources</targetPath> 555 + <filtering>false</filtering> 556 + <directory>Resources</directory> 557 + </resource> 558 + <resource> 559 + <targetPath>WebServerResources</targetPath> 560 + <filtering>false</filtering> 561 + <directory>WebServerResources</directory> 562 + </resource> 563 + </resources> 564 + <plugins> 565 + <plugin> 566 + <artifactId>maven-wolifecycle-plugin</artifactId> 567 + <groupId>org.objectstyle.woproject.maven2</groupId> 568 + <version>2.0.15</version> 569 + <extensions>true</extensions> 570 + <configuration> 571 + <source>${java.target}</source> 572 + <target>${java.target}</target> 573 + </configuration> 574 + </plugin> 575 + <plugin> 576 + <groupId>org.apache.maven.plugins</groupId> 577 + <artifactId>maven-javadoc-plugin</artifactId> 578 + <configuration> 579 + <javadocVersion>${java.target}</javadocVersion> 580 + <locale>en-AU</locale> 581 + <minmemory>128m</minmemory> 582 + <maxmemory>512m</maxmemory> 583 + </configuration> 584 + </plugin> 585 + <!-- 586 + TODO build numbering 587 + <plugin> 588 + <groupId>org.codehaus.mojo</groupId> 589 + <artifactId>maven-buildnumber-plugin</artifactId> 590 + <version>0.9.6</version> 591 + <executions> 592 + <execution> 593 + <phase>validate</phase> 594 + <goals> 595 + <goal>create</goal> 596 + </goals> 597 + </execution> 598 + </executions> 599 + <configuration> 600 + <doCheck>true</doCheck> 601 + <doUpdate>true</doUpdate> 602 + </configuration> 603 + </plugin> 604 + --> 605 + </plugins> 606 + <pluginManagement> 607 + <plugins> 608 + <plugin> 609 + <groupId>org.apache.maven.plugins</groupId> 610 + <artifactId>maven-compiler-plugin</artifactId> 611 + <configuration> 612 + <source>${java.target}</source> 613 + <target>${java.target}</target> 614 + </configuration> 615 + </plugin> 616 + </plugins> 617 + </pluginManagement> 618 + </build> 619 +</project> 620 + 621 +{{/code}} 622 + 623 +and ApplicationA - which has a couple of extra specific dependencies to add to those inherited from its parent. 624 + 625 +{{code title="/apps/ApplicationA/pom.xml"}} 626 + 627 +<?xml version="1.0"?> 628 +<project> 629 + <modelVersion>4.0.0</modelVersion> 630 + 631 + <!-- parent artifact --> 632 + <parent> 633 + <artifactId>apps</artifactId> 634 + <groupId>com.mywostuff</groupId> 635 + <version>1.0-SNAPSHOT</version> 636 + <relativePath>../apps</relativePath> <!-- e.g., (optional) if your app is under /trunk --> 637 + </parent> 638 + 639 + <!-- artifact identity --> 640 + <artifactId>ApplicationA</artifactId> 641 + <groupId>com.mywostuff.apps</groupId> 642 + <packaging>woapplication</packaging> <!-- woproject specific packaging --> 643 + 644 + <!-- specific properties --> 645 + <properties> 646 + <!-- general properties --> 647 + <mainclass>your.app.Application</mainclass> 648 + </properties> 649 + 650 + <!-- specific dependencies --> 651 + <dependencies> 652 + <!-- wonder frameworks --> 653 + <dependency> 654 + <artifactId>Ajax</artifactId> 655 + <groupId>${wonder.ajax.groupId}</groupId> 656 + </dependency> 657 + <dependency> 658 + <artifactId>ERCaptcha</artifactId> 659 + <groupId>${wonder.common.groupId}</groupId> 660 + <!-- requires jcaptcha-all below --> 661 + </dependency> 662 + <dependency> 663 + <artifactId>WOOgnl</artifactId> 664 + <groupId>${wonder.common.groupId}</groupId> 665 + </dependency> 666 + 667 + <!-- general libs --> 668 + <dependency> 669 + <artifactId>jcaptcha-all</artifactId> 670 + <groupId>com.octo.captcha</groupId> 671 + </dependency> 672 + <dependency> 673 + <artifactId>commons-collections</artifactId> 674 + <groupId>commons-collections</groupId> 675 + </dependency> 676 + <dependency> 677 + <groupId>ognl</groupId> 678 + <artifactId>ognl</artifactId> 679 + </dependency> 680 + </dependencies> 681 +</project> 682 + 683 +{{/code}} 684 + 460 460 === Packaging Applications as True WAR === 461 461 462 462 You can find steps to package WO Applications as True WAR [[here>>Packaging WO Applications as true WAR with Maven]].