#1736 Writing Java Application with Fantom

saltnlight5 Sun 18 Dec 2011

Hi,

I've read about BuildScript and JarDist, and that I can use [java] FFI in Fantom code. Can I use this method to write WAR/EAR application using Fantom, and then deploy to JEE server? Would I just build a myFantomApp.jar with a build.fan and then in my WEB-INF/web.xml map a servlet class to: fan.mypod.MyServlet?

Is there better way to load Java jar files besides manually copying them into {fan_home}/lib/java? I much prefer specifying classpath entries in etc/sys/config.props rather than duplicating jar files all over the place.

Also, I didn't see doc on how to use Ant or Maven with Fantom. I found #1294 that rfeldman tried to create a Maven Fantom Plugin, but I do not see any such project being release. Are these integration libraries exist?

Thanks, ~ Zemian

brian Sun 18 Dec 2011

ve read about BuildScript and JarDist, and that I can use [java] FFI in Fantom code. Can I use this method to write WAR/EAR application using Fantom, and then deploy to JEE server?

I haven't tried, but it should work. I believe a couple other people in the community have done that.

Is there better way to load Java jar files besides manually copying them into {fan_home}/lib/java?

Where I really want to go is to force Java dependencies to be wrapped as pods too so that all dependencies are cleanly encapsulated using one model. Then we can enhance fanr to install Java jars from Maven, etc as normal pods. The hold up on this is I that I have a hack in compilerJava which uses reflection to perform FFI type checking so those classes have to be system class path. Hope to fix that problem soon.

saltnlight5 Sun 18 Dec 2011

Hum ... it would be hard to push Fantom into existing Java shop without some of these tools.

I image that not very many people out there can afford a project from scratch. Improving in these areas would encourage developers to try out the language much more easier, and have a better chance in convincing their managers to adapt it.

go4 Mon 19 Dec 2011

Yes, "Zip" .jar and web.xml to get the WAR.

I don't think we need Ant or Maven. Fantom has its own librarys and tools.

saltnlight5 Mon 19 Dec 2011

I don't think we need Ant or Maven. Fantom has its own librarys and tools.

Well, it's nice Fantom has all that. It won't be nice to tell your boss when they already invested heavely in Java. I am saying it's easier to tell your boss that look, I can write just that MySerlvet in Fantom so you see how simple it will become, and leave all rest in tact. We are not changing any existing build, but just use Fantom as an library. Again, my point is that it will have a better chance to get into a existing Java shop, that's all.

Login or Signup to reply.