Build tool for Scala web application development - scala

While working with Scala frameworks such as Play! and Lift I was really amazed how these frameworks manage to create a full development stack from the source code up to the web application container (Jetty).
Right now I'm trying to configure a project on my own with the following features:
Automatic deployment on Tomcat 7 (I'm not using Jetty as I require JEE6 support)
WAR file packaging
Is it possible to do it with a build tool such as SBT or Maven?
Note: My goal is to create my own project structure, not using an existing framework (even though I'm taking some ideas from them).

There is a web plugin for SBT:
https://github.com/JamesEarlDouglas/xsbt-web-plugin
It gives you war packaging, but not automatic deployment (other than on Jetty, which it integrates, but which you don't have to use).
That said, I'd like to see a fork of that plugin that removes the Jetty dependency and adds an automatic external deployment option. Shouldn't be too hard to do.

Related

is maven required to develop spring based project?

I am developing (Single developer) a Spring based project for a Traveling based website.
and this is my first Spring based project, I want to use Maven in my project, because hosting sites like Cloud Bees expecting maven based project for deployment.
Is Maven required to develop Spring based project in Single developer environment.
FYI I am using eclipse IDE.
No it is not required.
You can develop in Spring using Ant or Maven or Gradle etc. or nothing at all.
Although it might be easier to do it with Maven (for library management)
It is not required per se, but you will run into some serious pain down the road if you don't use Maven or Gradle.
The first and foremost reason to use Maven or Gradle is to be able to very simply run tasks that occur ofter (like building a war or running the tests) and to be able to declaratively obtain the required dependencies (which in the case of a typical Spring application are plentiful).
If you are just starting to use build tool, I would suggest you take look at Gradle instead of Maven.

Implementing simple modules or extensions for axis2 as an eclipse project

I wish to setup an eclipse project for implementing a simple module but not a service for axis. I wonder if there're any templates I could use?
Secondly, I would like to ask if there are any information sources such as links around on how to build complex Axis2 applications in eclipse mainly focusing on module building as well
I appreciate your hints.
Best regards,
Alex
I could come along with this issue with my own solution:
Using an customized build.xml based on axis2 module builds I am able to build a module project in Eclipse using ant. I trigger this via key shortcut.
The build.xml has an deploy.module target that puts the module back to the axis2 $HOME/repository folder. Running there ant build.xml will deploy axis2 at whole as an war-file (EAR) the module containing there within to be ready to deploy in a container such as jboss.
The eclipse project is based on common java project (no dynamic web project) containing the $AXIS2/lib in CLASSPATH.
Since Jboss supports hot deployment on update, you can run jboss in a terminal or withing eclipse. I customized the latter build.xml to support easy jboss deployment.
This is a good solution for me.

What IDE setup and workflow is used for OSGi development?

I made quite a few easy OSGi test projects in Eclipse RCP. My typical workflow would always be:
Make 3 different projects: APIproject, Clientproject and Serverproject
Edit the MANIFEST.MF of APIproject to export the api package
Edit the MANIFEST.MF file of Clientproject and Serverproject to add the required API package
Choose "Run as..." > "Plugin Framework"
OSGi console starts in eclipse and everything seems to work
I also tried wiring things by using Declarative Services, which worked well like this too.
Now recently I wanted to try out iPOJO. The problem is that I get the feeling that I've been doing my OSGi development the wrong way.
Can it be that I should instead make 1 project en make it work like no OSGi is involved. And then afterwards, just export each package to its own bundle by means of (for instance) the BNDL tool? Should development be done in a normal Eclipse (java, not RCP) or any other java IDE for that matter?
So that's why I have these questions:
What IDE setup is normally used to develop OSGi with iPOJO?
And what is the normal workflow to be used when developing OSGi projects (maybe with iPOJO)?
Normally when I develop OSGi bundles (not Eclipse RCP bundles) I use the following tools:
Maven 2 as the build system.
Apache Felix maven-bundle-plugin to generate MANIFEST.MF automatically.
Pax Exam to create integration tests that run inside an OSGi container.
Pax Runner to execute my bundles in any OSGi framework (equinox, felix, etc.).
IntelliJ (or sometimes Eclipse) as a standard IDE without any OSGi extras.
I have not yet developed any Eclipse RPC bundles, but there's a new tool for Maven 6 Eclipse RPC build integration called Tycho (http://tycho.sonatype.org).

Can't get compile on save / hot deploy feature to work with maven based webapp in eclipse or netbeans

So our new webapp project is based on maven. I'm really liking the dependency management and IDE agnostic approach but I'm having problems with compilation and debugging.
Here's how I would currently get a clean copy of the project working
Check out the main project from SVN
Open the project in IDE (I've tried in eclipse 3.4 and netbeans 6.7)
The IDE will automatically open two subprojects one being the webapp, the other being a supporting utils jar.
From the command line I run mvn war:inplace on the webapp module which builds a working copy of the webapp with all dependencies in WEB-INF/lib/
This then runs fine but whenever I change a java class I have to clean and build / reload the app context.
I've googled high and low but no one seems to be complaining about this so I guess there must be something really obvious I'm missing. How is everyone else handling incremental compilation and hot deploy with maven?
To clarify all I'm looking for is the replicate the behavior I used to have before maven where I could make simple changes to java classes and they would be instantaneously compiled and hot deployed to a running webapp. I don't need anything fancy like jRebel etc I just want the new tool to give me the same functionality I enjoyed with my old tools.
If you can use mvn jetty:run it will read the classes and resources directly from the project. Using Maven2 Eclipse plugin and running the server embedded in Eclipse has auto-publishing, which gets you there in the end, although it's slower. And JRebel starting with 2.0 (as you may know) can map the Maven module directly to the deployed application, so you get instant build and redeploy. Those are the only solutions I know of.
Netbeans should support it out of the box. Though, there remains a bug related to this: http://netbeans.org/bugzilla/show_bug.cgi?id=177230
In-place deployment works for me with Netbeans 7.0.1 and Tomcat 6.0.x if I use Tomcat 7.0.x in-place deployment doesn't work. Tomcat always copies application to $CATALINA_HOME/temp :(

How to create stand-alone lift web application?

How to make a standalone lift application? Which tools/libraries to use? How does the performance compare to using lift application as a war in some application server?
With onejar maven plugin http://onejar-maven-plugin.googlecode.com/svn/mavensite/usage.html and maven I could package jetty and project with dependencies inside one jar.
The part of the question on performance doesn't really fit with the rest. You are primarily asking how to package the Lift application as a single JAR/WAR. This doesn't have anything to do with the runtime.
At runtime you will still be running inside a Servlet container (could be Jetty, Tomcat or a full-blown Java EE server). How you package your application won't affect the performance.
You could take a look at Hudson (a great Continuous Integration Server) to see how they deliver as a single WAR file that contains an embedded Servlet container. You can download the WAR file and run it from the command line: java -jar hudson.war
I know this is an old question, but...
If you are using sbt, I wrote a plugin to produce 'executable' wars like those mentioned above.
https://github.com/glenford/sbt-jetty-embed