On Nov 20, 2015, at 9:55 AM, Henrique Prange <[email protected]> wrote:

> Hi Ramsey,
> 
> I found a way to produce the desired result if you cannot avoid the use of 
> WOBootstrap.jar. You may consider it a hack, but it should work.
> 
> 1) Create a lib folder into your project.
> 
> 2) Copy the WOBootstrap.jar file into the lib folder.
> 
> 3) Create a wobuild.properties file into the lib folder containing the 
> following properties:
> 
>    wo.bootstrapjar=lib/WOBootstrap.jar 
>    wo.wolocalroot=foo
>    wo.wosystemroot=bar

For others following along, or future me:

Beware the space at the end of .jar !

> 
> 4) Create a .mvn folder into your project.
> 
> 5) Add a file called jvm.config into the .mvn folder containing the following 
> information:
> 
>    -DWOBUILD_PROPERTIES=lib/wobuild.properties
> 
> Steps #4 and #5 require Maven 3.3.1 or greater. The properties from the 
> jvm.config file are appended to any Maven command executed inside the 
> project. You have to run the Maven command with the -D option explicitly for 
> older versions. For example:
> 
>    mvn clean install -DWOBUILD_PROPERTIES=lib/wobuild.properties.
> 
> It isn’t a beautiful solution, but it is isolated and keeps your build 
> reproducible across environments.

Thanks! This was the tip I needed.

I made one modification. I am using dependency:copy to pull the WOBootstrap.jar 
from my dependency repository instead of checking it into git and that works 
just as nicely.

> Anyway, I keep saying that unless there is strong reason (as you have), using 
> the WOBootstrap.jar should be discouraged.

I actually had this crazy idea of using the maven shade plugin to merge all the 
dependencies into a single Uber jar. The nice thing about the shade plugin is 
that it can also minimize the jar and remove unused classes. I tried it and it 
was able to shrink my jar down from 23.6 MB to 14.6 MB. It just didn’t run. 
Something about ERX something can’t read the properties file :P

> 
>> I notice on the rather dated roadmap that 3.0 was intended to merge/replace 
>> the woproject ant stuff.
>> 
>> https://wiki.wocommunity.org/display/WOL/Roadmap
>> 
>> Have you ever made a branch for that or had any progress in that direction?
> 
> No progress in that direction.
> 
>> Are there any major hurdles blocking that goal?
> 
> 
> I guess lack of interest? The cost to produce a general library that could be 
> used by both the Ant tasks and the Maven Mojos wouldn’t worth it.

I was thinking more along the lines of never using ant again ;)

Thanks again for your help Henrique!

> 
> Cheers,
> 
> Henrique
> 
> PS.: The wo.wolocalroot and wo.wosystemroot are required to avoid an 
> incorrect BUILD FAILED message.
> 
>> On 18 de nov de 2015, at 14:26, Ramsey Gurley <[email protected]> 
>> wrote:
>> 
>> Thanks for the reply Henrique. I just wanted to make sure I am not 
>> overlooking some special magic property to make it work or if there is some 
>> way to reference it from my dependency repo. I may see if I can figure out 
>> how to make the old woapp script properly escape the () in the path, since 
>> it appears to work (at least, on windows 10) otherwise. Then I just won’t 
>> need(?) WOBootstrap.jar. 
>> 
>> I gather this is the desired way to go if I want to use WOInject at some 
>> point in the future, based on my reading of old threads from the mailing 
>> list. Referencing magic jars outside the dependency repo seems like a step 
>> backwards when trying to use maven.
>> 
>> I notice on the rather dated roadmap that 3.0 was intended to merge/replace 
>> the woproject ant stuff.
>> 
>> https://wiki.wocommunity.org/display/WOL/Roadmap
>> 
>> Have you ever made a branch for that or had any progress in that direction? 
>> Are there any major hurdles blocking that goal?
>> 
>> On Nov 18, 2015, at 7:40 AM, Henrique Prange <[email protected]> wrote:
>> 
>>> Hi Ramsey,
>>> 
>>> Theoretically, defining the wo.bootstrapjar variable in the 
>>> build.properties should work. Defining the full path as you did is another 
>>> option too. However, as soon as the Maven plugin uses an old version of 
>>> woproject-ant-tasks, it may not work as we expect it to work (considering 
>>> the current source code for this library).
>>> 
>>> I’ll try to debug the plugin execution to understand what’s going on.
>>> 
>>> Cheers,
>>> 
>>> Henrique
>>> 
>>>> On 17 de nov de 2015, at 22:25, Ramsey Gurley <[email protected]> 
>>>> wrote:
>>>> 
>>>> Also, I’ve tried creating
>>>> 
>>>> /System/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar
>>>> 
>>>> directly on the build server, as that appears to be the default location 
>>>> where WOVariables looks. Still getting the old and busted appstart.cmd 
>>>> file.
>>>> 
>>>> On Nov 17, 2015, at 3:19 PM, Ramsey Gurley <[email protected]> wrote:
>>>> 
>>>>> Hi maven people,
>>>>> 
>>>>> I’m building a maven project with woapplication packaging. The 
>>>>> Application.CMD file for windows is coming from the woapp instead of the 
>>>>> woapp_52 directory in the woproject.jar. The woapp script is broken 
>>>>> because it does not gracefully handle directory paths like \ProgramFiles 
>>>>> (x86)\ on Windows the way woapp_52 script does. I’m getting it because 
>>>>> WOBootstrap.jar does not exist, and therefore, it assumes I’m using old n 
>>>>> busted WO 5 or 5.1. I tried adding 
>>>>> wo.bootstrapjar=/path/to/wotaskd/WOBootstrap.jar to build.properties, but 
>>>>> that did not work. I tried adding that as a property in the pom, but that 
>>>>> did not work either.
>>>>> 
>>>>> Can anyone tell me how to build a maven project with woapplication 
>>>>> packaging such that one gets the launch scripts from woapp_52 instead of 
>>>>> woapp?
>>>>> 
>>>>> Thanks,
>>>>> 
>>>>> Ramsey
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list      ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/hprange%40gmail.com
>>>> 
>>>> This email sent to [email protected]
>>> 
>> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to