javamavenwebobjectsproject-wonder

Maven WebObjects, Wonder, maven build does not include framework resources (images etc)


I have worked with WebObjects for quite some time. I decided to move to a maven build and for some reason my associated frameworks resources are not being found in /Contents/Frameworks in the built product. So when I run the D2W application I am getting no Image files, stylesheets or any web files that are part of the frameworks.

The application appears to compile fine. but when run the application, resources from the frameworks are not being found. I found the referenced frameworks under Contents/Frameworks. I did attempt to use WOFrameworkBaseURL to point to /WebObjects/myappname/Frameworks and that did not solve the issue.

Here is my POM.XML

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mozaic</groupId>
    <artifactId>mozaicv2</artifactId>
    <packaging>woapplication</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>mozaicv2 WebObjects Application</name>
    <url>http://maven.apache.org</url>

    <properties>
        <!-- properties used for filtering and dependency management -->
        <jvmtarget>1.6</jvmtarget>
        <mainclass>com.nttdata.mozaicv2.application.Application</mainclass>
        <webobjects.groupId>com.webobjects</webobjects.groupId>
        <webobjects.version>5.4.3</webobjects.version>

        <wonder.core.groupId>wonder.core</wonder.core.groupId>
        <wonder.version>7.1</wonder.version>
        <wonder.classifier>wo54</wonder.classifier>
    </properties>

    <repositories>
        <!--
                <repository>
                    <id>wocommunity</id>
                    <name>WOCommunity Maven 2 Releases Repository</name>
                    <url>http://maven.wocommunity.org/content/groups/public</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
        -->
        <repository>
            <id>wonder</id>
            <name>WOCommunity Maven 2 Releases Repository</name>
            <url>https://mvnrepository.com/artifact</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>wocommunity</id>
            <name>WOCommunity Maven 2 Releases Repository</name>
            <url>http://maven.wocommunity.org/content/groups/public</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <finalName>${project.artifactId}</finalName>
<!--
        <resources>
            <resource>
                <targetPath>Resources</targetPath>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <targetPath>Resources</targetPath>
                <directory>${basedir}/src/main/components</directory>
            </resource>
            <resource>
                <targetPath>WebServerResources</targetPath>
                <directory>${basedir}/src/main/webserver-resources</directory>
            </resource>
        </resources>
-->
        <plugins>
            <plugin>
                <groupId>org.objectstyle.woproject.maven2</groupId>
                <artifactId>maven-wolifecycle-plugin</artifactId>
                <version>2.0.17</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${jvmtarget}</source>
                    <target>${jvmtarget}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <archiveClasses>true</archiveClasses>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>wonder.ajax</groupId>
            <artifactId>Ajax</artifactId>
            <version>7.1</version>
        </dependency>
        <dependency>
            <groupId>wonder.eof</groupId>
            <artifactId>ERAttributeExtension</artifactId>
            <version>7.1</version>
        </dependency>
        <dependency>
            <groupId>wonder.ajax</groupId>
            <artifactId>ERCoolComponents</artifactId>
            <version>7.1</version>
        </dependency>
        <dependency>
            <groupId>wonder.core</groupId>
            <artifactId>ERDirectToWeb</artifactId>
            <version>7.1</version>
        </dependency>
        <dependency>
            <groupId>${wonder.core.groupId}</groupId>
            <artifactId>ERExtensions</artifactId>
            <version>${wonder.version}</version>
        </dependency>
        <dependency>
            <groupId>wonder.d2w</groupId>
            <artifactId>ERModernDefaultSkin</artifactId>
            <version>${wonder.version}</version>
        </dependency>
        <dependency>
            <groupId>wonder.d2w</groupId>
            <artifactId>ERModernDirectToWeb</artifactId>
            <version>${wonder.version}</version>
        </dependency>
        <dependency>
            <groupId>wonder.d2w</groupId>
            <artifactId>ERModernLook</artifactId>
            <version>7.1</version>
        </dependency>
        <dependency>
            <groupId>${wonder.core.groupId}</groupId>
            <artifactId>ERPrototypes</artifactId>
            <version>${wonder.version}</version>
        </dependency>
        <!--webobjects-->
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaDirectToWeb</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaDTWGeneration</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaEOAccess</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaEOControl</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaEOProject</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaFoundation</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaJDBCAdaptor</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaWebObjects</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaWOExtensions</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaXML</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>wonder.misc</groupId>
            <artifactId>WOLips</artifactId>
            <version>${wonder.version}</version>
        </dependency>
        <dependency>
            <groupId>${webobjects.groupId}</groupId>
            <artifactId>JavaWOJSPServlet</artifactId>
            <version>${webobjects.version}</version>
        </dependency>
        <dependency>
            <groupId>${wonder.core.groupId}</groupId>
            <artifactId>WOOgnl</artifactId>
            <version>${wonder.version}</version>
        </dependency>
        <dependency>
            <groupId>${wonder.core.groupId}</groupId>
            <artifactId>ERServlet</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>
</project>```


Please help.

Thanks in advance.

Solution

  • This is where I would start:

    <plugin>
      <groupId>org.objectstyle.woproject.maven2</groupId>
      <artifactId>maven-wolifecycle-plugin</artifactId>
      <version>2.0.17</version>
      <extensions>true</extensions>
    </plugin>
    

    That is quite an old version of the WOLifecycle Maven Plugin. Replace it with this:

    <plugin>
      <groupId>org.wocommunity</groupId>
      <artifactId>wolifecycle-maven-plugin</artifactId>
      <version>2.3</version>
      <extensions>true</extensions>
    </plugin>
    

    If your issue persists, we can investigate further. As an aside, while I am happy to answer questions here on StackOverflow, there's probably a marginally larger community over on the WebObjects Development mailing list.