Reputation: 17226
We have an existing ColdFusion application, we are considering adding additional Java content to it.
While I know it is possible to compile a jar and use that as a library I am looking for something closer to a pure java-ee experience where you hit save on a java file, the IDE redeploys to the server and your application is available milliseconds after you hit save.
I understand that the ColdFusion server is actually a Tomcat server and uses java-ee "under the hood" so my hope is to be able to have a java-ee project that just happens to also have a few .cfm and .cfc files in it. I couldn't get NetBeans to recognise the ColdFusion server as a Tomcat server though.
Alternatively I have tried deploying a WAR form ColdFusion server to a Glass Fish server then deploying my project to that. Of course deploying a java-ee WAR to a glass fish server is easy but of course it is deployed next to the ColdFusion application not within it, I wasn't able to find a way to correct that.
How can I deploy a java-ee WAR to a ColdFusion server (which may or may not also have ColdFusion .cfm and .cfcs in it)? (or how can I get a Java-ee instant deployment experience while also using ColdFusion)
Upvotes: 4
Views: 1712
Reputation: 17226
The only solution I could find was to turn the entire relationship on it's head and include ColdFusion as a War Overlap (similar to but different from including it as a library). This entire thing can then be deployed to a Java-EE compliant server (e.g. GlassFish). The War overlay is created using Maven
Download ColdFusion, start the install as usual. Then choose "Java-ee configuration">"WAR File" as the install option. This will give you the whole of ColdFusion server as a .war file (the conventional use for this is that you can install ColdFusion on any Java-EE server, we're going to use it slightly differently from that).
We're going to be using maven to generate the war overlay so we'll need maven to be able to access the ColdFusion war you just generated. You can add the WAR to your local repository using the following command (edit for your ColdFusion version and where you saved the WAR)
mvn install:install-file -DgroupId=com.adobe.coldfusion -DartifactId=coldfusion -Dpackaging=war -Dversion=10 -Dfile=c:/coldfusion/cfusion.war -DgeneratePom=true
If maven's bin isn't in your Path environment variable you may need to change directory to it. This will vary depending on your system but assuming you are using the netbeans plugin for maven (which comes by default) you will what something like the following (edit for your Netbeans install location)
cd C:\Program Files\NetBeans 8.0.1\java\maven\bin
In Netbeans create a new Maven Java-ee project. Then (in the resulting project) open your Project Files>pom.xml file and add the War overlay dependancy
<dependencies>
<!-- other dependancies -->
<!-- This is the war overlay -->
<dependency>
<groupId>com.adobe.coldfusion</groupId>
<artifactId>coldfusion</artifactId>
<version>10</version>
<type>war</type>
<scope>runtime</scope>
<optional>false</optional>
</dependency>
</dependencies>
It should now be possible to include ColdFudion files (within the Web Pages directory) along side a normal Java-EE application
References:
Upvotes: 2