On Nov 20, 2015, at 9:55 AM, Henrique Prange < email@hidden> 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.
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@hidden> 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.
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@hidden> 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,
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|