Using XCore generated classes in a war aggregating multiple Maven projects - war

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.

Related

Do I Need To Package the Windows dlls With A JavaFX Application?

I downloaded the latest version of JavaFX from the Gluon website and extracted the zipped SDK. As well as the /lib directory that stores the jars I also see a /bin directory packed full with various dlls. If I build a Java/JavaFX application and bundle it using Maven then do I need to also bundle these dlls? And if so, then do a similar process of shipping native libs for Linux and Mac? Or, can I just get away with packaging the jars?
Thanks.

How to use Spring 5.0 in NetBeans 8.2?

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

How to use Bootstrap in an ASP.Net Core 2.0 Application?

I know that Bower is not recommended to be used with ASP.Net Core 2.0. Instead, I used NuGet to download Bootstrap dependency into my project. Therefore, I can't reference the files in my Layout view like I used to do with Bower using:
<link href="~/lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
I am trying to use NuGet to get a cleaner code. However, I can't seem to be able to reference this package in my project. Anyone has an idea how to use/reference bootstrap installed through NuGet in an ASP.Net Core 2.0 application?
In .NET Core, Nuget is no longer suitable for deploying client files. This was a design decision made by Microsoft. Instead, you can use any of a host of client build/deploy tools like npm, or my preference is to simply link to the libraries you need st a CDN location. This eliminates deployment issues and offers better performance for your users.
In Visual Studio 2017 Preview, you can use Library Manager:
Library Manager (“LibMan” for short) is Visual Studio’s experimental
client-side library acquisition tool. It provides a lightweight,
simple mechanism that helps users find and fetch library files from an
external source (such as CDNJS) and place them in your project.
Soon it will available in VS stable version.
Add the "Package Installer" and "Bundler & Minifier" Extensions into Visual Studio (both created by Mads Kristensen)
Use the Package Installer to install client libraries using "npm" which is widely supported.
This downloads the files to a node_modules folder in the root of your web project.
Use Bundler & Minifier to copy/bundle/minify as you like for dev and/ or production from the node_modules folder to where you want them in the wwwroot folder.
First, install a nmp configuration file, and add bootstrap like in bower.json and save. Visual studio will download it. This is available for all packages. You can find the installed packages in the nmp node under the dependencies node of your project. Find more informations here

Share proxy/sequences references between ESBConfiguration projects

We have the following problematic :
we have an ESB Configuration project containing proxies/sequences that we want to reuse inside an other ESB Configuration Project (we just want to reference them not to copy) and finally build them inside the same CAR.
How can we do it with DeveloperStudio/maven ?
Tks
Nicolas
All developer studio projects are fully maven comfortable . Please follow the following steps to create projects
Create maven multi-module project.
Then create the ESB configuration project(As a best practice do it inside the
Multi-module project.).
Create relevant ESB artifact(Proxy/Sequence) inside that ESB config project.
Finally create the Composite application project (As a best practice do it inside the
Multi-module project too).
Now go to the maven multi-module project location and build it(mvn clean install)
Once build succeed ,you can find the Car file inside composite application target directory
You not need to build project by project just build the multi-module project only.
Hope this help !!

deploy flex application on tomcat server (not localhost) with blazeDS starting in eclipse

I have a locally developed flex application which i would now deploy on a live server. Those are the constraints:
Using blazeDS with java code
Code depends on other project in eclipse
the other project has several dependencies on 3rd party libs.
Using some external flash .swc libs
some web.xml settings are custom
In another post the structure for the exported folder is explained:
What needs to be in a .war file to deploy a Flex application?
In the default usage of Flash Builder i can create a release build and store it somewhere. This will create the release version of all the flex content.
I now want to export the .war file within the export function of eclipse and here comes the problem:
How can i exclude the files not needed in the war file. There is a debug build of the flex app and some other files i do not need.
How can i automatically insert the dependend libs of the imported eclipse project to the web-inf lib folder. When i try to export the release the function sais that the imported eclispe project cannot be created by the release process but it is within the lib folder of web-inf on .war export except the dependencies.
Can somebody point me to the documententation of flashbuilder regarding exportinmg and deployment.
Maybe i need an ANT process to optimize that. What do you think?
Thank you
For everything you just said, there are 2 ways of doing it:
1) Create it manually by copy pasting what you need in your war file into a folder, removing what isn't needed then create said war file using command line.
2) Create an automation script that does it all for you. This could be ANT or Maven (I personally prefer Maven for it's dependency management).
The latter is the enterprise way of doing it because it's easy to run ("mvn clean install war") and you can attach the script to an automation engine (like hudson, bamboo, teamcity, etc) which can then compile/test/deploy everything something is committed to your source control.

Resources