Mailing List webobjects-dev@wocommunity.org Message #417
From: Aaron Rosenzweig <aaron@chatnbike.com>
Subject: Re: Maven Components subfolders incompatibility?
Date: Tue, 31 Jan 2023 08:59:37 -0500
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Cc: Ramsey Gurley <Ramsey.Gurley@practicemojo.com>
Hi thank you Ramsey. You are always so kind and fast to reply. 

Yes! your advice of overriding “installPatches()” to manually kick WO to have a mapping to the missing components works! As I click around the app I’m finding lots of WOComponents having this problem but they only are discernible as you step into them. 

It’s concerning but a good workaround. I didn’t have these problems before with ANT builds. <<scratches head>> 

In other news I noticed there are upgrades on the maven lifecycle plug in. In your docker example, you are using v2.2.1 (others recommended 2.3-SNAPSHOT) and now there is a 2.5 - upgrading didn’t make any changes for the component discovery but I’ll note the following changes in the POM to include it:

1) <groupId>org.objectstyle.woproject.maven2</groupId> -> <groupId>org.wocommunity</groupId>

2) <artifactId>maven-wolifecycle-plugin</artifactId> -> <artifactId>wolifecycle-maven-plugin</artifactId>

3) <version>2.3-SNAPSHOT</version> -> <version>2.5</version>


Our Viking friend also an alternative plugin: https://github.com/undur/vermilingua-maven-plugin
 
Thank you,
— Aaron

On Jan 30, 2023, at 3:46 PM, Aaron Rosenzweig <aaron@chatnbike.com> wrote:

Hi All,

I discovered this option for the Maven lifecycle plugin:

<configuration>
<flattenComponents>true</flattenComponents>
</configuration>

I tried it and I can see inside the target directory it was honored… but the error message is still the same, cannot find UserSwitcher.

I’m trying to launch from within Eclipse but I don’t understand how to get it to go. I don’t see the .woa built anywhere, is this a type of bundles build process? Or where is the .woa built? It’s not in the target folder.

Thank you,
— Aaron

On Jan 30, 2023, at 2:12 PM, Aaron Rosenzweig <aaron@chatnbike.com> wrote:

I’m trying to convert my Eclipse workspace front ANT -> Maven builds but I’ve run into a snag. Hoping a kind WOrrior can lend me their axe

When I launch the app it cannot find some WOComponents. I get errors like:

WOBundle.lookForClassInAllBundles(UserSwitcher) failed!

<com.webobjects.appserver._private.WOComponentDefinition> WARNING: Unable to find component class named "UserSwitcher".  If this is not intended to be a classless component, check your framework settings and the contents of your classpath file (in the .woa's Contents/<PLATFORM_NAME> subdirectory).



“UserSwitcher.wo” is a component in this app, not an included framework.

It lives in: Components/Permissions/UserSwitcher.wo

It seems that the “Permissions” subfolder is causing issues as components defined directly under Components are discovered and work properly.

I would rather continue to keep subfolders in Components if possible… while using Maven.

What I think is the relevant part of the POM looks like:
<resources>
<resource>
    <targetPath>Resources</targetPath>
    <filtering>false</filtering>
    <directory>Components</directory>
</resource>
<resource>
    <targetPath>Resources</targetPath>
    <filtering>false</filtering>
    <directory>Components/Permissions</directory>
</resource>
</resources>

When I check the “target” directory… which I think is where the Maven temporary files live… I do find the following intact:
target/classes/Resources/Permissions/UserSwitcher.wo

So it sort of looks like it is working but the running app in Eclipse cannot find this component. How does Eclipse launch it from here? Is it a type of bundle-less build? Where is the next step to debug to figure out how UserSwitcher.wo is not getting put into the right location?

Any help appreciated, thank you :-)
— Aaron


Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster