Attempting to make some small changes to Apache's Velocity engine.

This is what I'm able to and should not do.

I am creating a switch to the merge function(). The modification I am making does not matter because I've not managed to get yet. ) Right now i'm compromising for a println statement firing.

I've two references to merge(). Basically alter the function to mergeBAD() Eclipse informs me it aren't able to find merge(). Is sensible right? I did previously use in my class build path the 2 jars that you will get when installing velocity but rather I have produced a task while using src files provided and used THAT project like a dependency. Again, the very fact that's aren't able to find merge() after i relabel it to mergeBAD provides me with hope.

However when I'm running my web server, hit a breakpoint and walk into the merge call, it cannot discover the source! I point it towards the project all over again, also it "finds" the origin, no changes I have made (particularly the println claims) are hit. They're simply missed over. :(

What on God's eco-friendly earth may be leading to this? It's driving me insane. I have spent the whole day today trying to puzzle out wrong. I can not continue without having the ability to change Velocity. Precisely what code is made of eclipse running the rate files from?

Thank you ahead of time SO! :)

This can be a typical situation of confusion between build classpath and runtime classpath.

Your build classpath consists of references for your Java project (that contains the alterations to Velocity)... however i wager your runtime classpath holds references towards the original Velocity JAR files.

Controlling build classpath and runtime classpath in Web projects under Eclipse (the WTP - Internet Tools Project) continues to be dealing with massive changes during the last couple of WTP releases. We are able to show you through. Should you physically added Velocity's JAR files to your WEB-INF/lib, allows begin by getting rid of them.

OK, once you take away the Velocity.jar file from WEB-INF/lib, perform the following:

  1. Right-click on the project, choose "Qualities".
  2. Visit "Java build path". Choose the "projects" tab and make certain that the custom Velocity project (allows refer to it as "MyVelocity") is NOT there.
  3. Still in "Java build path", choose the "Libraries" tab and make certain that no Velocity JAR can there be either.

By using the steps above, we washed your internet-Application from the reference whatsoever to MyVelocity (any project) or other Velocity JAR.

Now comes the enjoyment part. I'll instruct you the way to properly "add" Java projects to Web projects as dependencies.

  1. Still within the project's qualities, visit Deployment Assembly.
  2. Click "Add".
  3. Choose "Project" after which "Next".
  4. Choose "MyVelocity" and make certain the "Web Library Reference" checkbox is checked.
  5. Click "Finish".

In the Deployment Assembly dialog, you need to now see MyVelocity planned into WEB-INF/lib/MyVelocity.jar.

Click OK.

What we should did by that's to map MyVelocity like a WEB-INF/lib dependency. By doing that, MyVelocity is instantly put into the compile-time build-path too - so it's very essential that you don't add it you to ultimately the build-path, leading to duplicate build-path records.

Everything should meet your needs now. Tell me for those who have any problems.

P.S. these instructions are correct if you are creating a stand-alone WAR project in case your WAR file is part of an EAR, you might wish (under certain conditions, for instance if MyVelocity can be used by other J2EE modules within the EAR) to map MyVelocity in a different way, to some common location if that is the situation, tell me and I'll elaborate further.