My goal is to package an executable spring-boot jar - a web app with tomcat embedded. I would like to use sbt but I don't find a straight forward way to do this. There are maven and gradle spring-boot plugins, but I don't see anything even close in sbt. My question is - is there a spring-boot sbt plugin, if not, is such functionality planned?
Related
When I create a Java Web project in NetBeans and select a Framework, in this case Spring Web MVC, only two options appear:
Version 4.0.1
Version 3.2.7
You can do this in Netbeans:
Download the Spring Framework you need from here
Extract the contents of the archive and copy the contents of the lib directory to your netbeans location e.g /home/stanley/netbeans-8.2/java/modules/ext/spring-(version) e.g 5.1.4
On your netbeans go to Tools > Libraries > New Library
Name your Library as Spring Framework (version) e.g 5.1.4 and add all the jars from the location in 2 above.
Restart your netbeans application.
You should have the new Framework as shown in the diagram below:
TL;DR
The easiest way to create a new spring project is using Spring Initializr. All you need to do is fill in the form, download the project, unzip it and open in NetBeans.
Explanation
Regardless of a language and IDE, it is usually good idea to create a new project based on a standard build-tool for the language's ecosystem and avoid creating an IDE-specific project. That makes it easier to share the project with people who use a different IDE and switch your IDE in the middle of the project.
There are several build-tools for Java ecosystem but I'd suggest to pay attention to two of them: Maven and Gradle. Those are most widespread and supported by IDEs.
NetBeans supports Maven out of box. It supports Gradle too but in 8.2 you are supposed to install a support plugin for Gradle (from Tools -> Plugins menu).
You can generate a new Maven or Gradle project using NetBeans. Select corresponding menu item when selecting the type of the project.
Then you will have to add the dependencies of the project to its descriptor (pom.xml for Maven or build.gradle for Gradle). See the documentation for the build-tool of your choice to understand how exactly to do that.
Spring provides Spring Initializr service to generate a new project based on spring's libraries. It is the easiest way for a quick start.
Since you are using Netbeans and it supports Maven out of the box, you can get an existing Maven archetype to setup a basic Spring application for you to start from.
Although there isn't any official archetype, there are a lot of really nice 3rd party ones like https://github.com/kolorobot/spring-mvc-quickstart-archetype
The steps to start a new project are quite fast and straight forward (Netbeans 11)
File -> New Project -> Java with Maven -> Project from archetype
In the search filter enter spring-mvc-quickstart-archetype, enter your project details and click Finish
I come from a background of Java, PHP and NodeJS development. I have successfully built continuous integration/continuous deployment environments using these languages based on a Linux Platform but now I am working in an environment with a mix of .NET web development and Java based web development.
I would like to build a CI/CD environment that shares tools and concepts as much as possible. The workflow that has worked in the past and seems to be pretty standard is:
Check code into Git
Jenkins checks out the code, runs tests
Jenkins builds the code if tests pass
Jenkins builds a package. WAR file, RPM etc. and pushes it to an artifact repo, Maven, Yum repo, Artifactory, Nexus etc.
Jenkins deploys the package to a given environment by simply pulling the correct version of an artifact and pushing it to a given box. I like to use Ansible or Puppet or some nice configuration management tool for this step and let that handle the versioning and environment specific changes.
I know Microsoft has built tools that can do similar things but I would like to keep things consistent across the organization and I feel like Jenkins is the gold-standard and has been battle tested for a hundred years while Microsoft’s CI tools are relatively new.
I am able to set up a Windows based Jenkins slave compile the code using the MSBuild plugin (This is an excellent tutorial if you are interested http://blog.couchbase.com/2016/january/continuous-deployment-with-jenkins-and-.net). I am stuck on how to package the code. I had thought NuGet would be a good choice for this but I can’t seem to find any guidance on building/deploying NuGet packages for ASP.NET applications and deploying them. I prefer NuGet to something like the web application zip file as the packages are versioned.
Is NuGet the answer or is there something else out there that could support my needs or should I be altering my thinking for CI/CD in a Microsoft environment?
I have a problem in a SBT project where there are two different versions of Apache HttpClient 4.1.3 and 4.3.1.
I made a small sbt project to reproduce the issue - https://github.com/eirslett/sbt-httpclient-problem
Does anybody know how this can be resolved? How can I have a sbt plugin that uses version 4.3.1, and still do HTTP requests from my build?
I am creating a web application in ruby-on-rails 4. There are some jar files of another application with which i have to integrate my application. I have to call some methods of the class files contained in jars.
Please let me know how can i call methods in jar files from my RoR application?
Any pointers/links will help.
Thanks.
You might want to check out jruby. It's an implementation of ruby that runs in a JVM and has access to everything that a java app would. Here are instructions on using jars and java classes with jruby. You can still use rails with jruby.
Heroku has a migration guide that details moving from ruby on rails to jruby on rails that might help you out, as not all gems are compatible with jruby.
I have a maven project called myproject.app. I also have another project using vaadin and gwt called myproject.ui and another project, which is an Xcore-Project converted to Maven called myproject.model.
I want to aggregate them all in a war. For this I have a myproject.war with a pom declaring the dependencies.
For Vaadin and GWT everthing is working fine as these projects are pure maven projects. The Xcore project gives me headaches because I can't manage to provide the Plugin Dependencies declared in this project in the war.
I have tried to add the needed libraries in the pom but I can only get old versions (2.2.3) from Central - the XCore project uses 2.8./3.8..
How can I solve this?
The answer is to convert the eclipse dependencies (EMF, XCore ...) to maven artifacts using the Maven Tools 4 Eclipse.
http://wiki.eclipse.org/MT4E_FAQ
For professional usage it is necessary to setup a maven repository, I used Nexus with success (if you are developing locally and alone it would be enough to install the artifacts in you local repository).
http://www.sonatype.org/nexus/
You can get it working by setting up a hosted repository with the converted Eclipse artifacts (documented in the mt4e reference) and creating a repository group aggregating the preconfigured maven central proxy and the hosted repository with the eclipse artifacts.
You need to setup your local settings.xml to use the nexus and you're good to go. Eclipse's artifacts are usable via maven coordinates.
Keep the orbit artifacts in mind and design your patch files carefully.