[#120] Made some classloader changes for running in an OSGi environment.

We use the same classloader selection mechanism at runtime as was there
for compile-time choosing for the OSGi/non OSGi environments. This
enables the running (compiled) template to reference other classes in
the classpath, but not necessarily in the classloader of
getClass().getClassLoader().

Also fixed the initialization code of the ScalaCompiler and
OsgiScalaCompiler to use a method for compiler creation. The
initialization of the ScalaCompiler.compiler was happening even when the
subclass overrode the .compiler field, causing it to fail in an OSGi
environment.  Now we just override the creation method, and it works as
expected.
Use buildhelper plugin to include src/main/scala as source dir

Including src/main/sca as a project source directory. This means that
when the -source.jar is built using source:jar the scala sources are
included.
Do not retry template compilation twice
Reset scala Source before read to support multiple reads

A Scala Source can only be read once and then has to be reset in order to
be read again. Therefore, in SourceResource, if the position is not 0,
close the existing resource, and then call reset to ensure the Source can
be read from the beginning.

Some Scala Source implementations provide reset out of the box, however
others (such as ones created by Source.fromInputStream) need the creater
of the Source to provide the reset function via the withReset method.
Avoid duplicate TemplateSource reads unless using pipeline

TemplateEngine was calling source.text even if pipelines were not being
used, causing the text function of the underlying Resource to be called
more than once.

Move the call to source.text into the match for pipeline so that the
underlying Resource is read only once unless pipeline's are being used,
in which case the Resource will (currently) be read twice as before.
Merge pull request #19 from vivosys/no-compile-retry

Do not retry template compilation twice
Merge pull request #18 from vivosys/source-reset-fix

Source reset fix
Merge pull request #16 from vivosys/osgi-fix

[#120] Made some classloader changes for running in an OSGi environment.
Merge pull request #17 from vivosys/build-source-jars-with-scala

Use buildhelper plugin to include src/main/scala as source dir
Do not create ServletTemplateEngine for every view, reuse once created one. Invoke boot class.
Override Global.classPath to our generated classpath.

In ceratain situations the compiler bypasses the rootLoader and accesses the classPath directly, for example
https://github.com/scala/scala/blob/v2.9.2/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala#L1130
Add bundle to classpath only once irregardles of the number of imported packages.
LinkedHashSet is used to preserve correct order.
Removed explicit adding of scala-library, scala-compiler and scalate-core bundles to compiler classpath.
Client bundle needs to import relevant packages anyway to load the classes later, so the necessary
bundles will be added by ClassPathBuilder.fromBundle.
Merge pull request #28 from maslovalex/spring-integration-improve

Do not create ServletTemplateEngine for every view, reuse once created o...
Merge pull request #26 from rkrzewski/osgi

A few OSGi related changes
updated mvnplugins to 1.27-SNAPSHOT, awaiting Scala 2.10
compatible release
Removed redundant try/catch
Exception wrapping: let VirtualMachineError and ThreadDeath pass
unaffected
Rethrowing excpetion: use explicit Throwable type ascription to
pacify the compiler
Discarding caught exception: let subclasses of Error pass unaffected