Use ram disk for building Vaadin 8 web app in IntelliJ 2017.1 - intellij-idea

I would like to speed up compile/build process when making a Maven-based Vaadin 8 app in IntelliJ 2017.1, as well as avoid chewing up my flash-based storage needlessly, by outputting intermediate and final products on a ram drive.
How to configure IntelliJ or my project to use a ram disk?
I am currently running the Vaadin app using the built-in Jetty Servlet container using the included Maven task. In the future I expect to have IntelliJ coordinate with a separate installation of Tomcat Servlet container.
Some perusing revealed:
Project Structure > Project > Project compiler output
Project Structure > Modules > Paths (tab) > Compiler output
Project Structure > Artifacts
Are any or all of those required to be redirected to the ram disk?
Is there a faster, easier, or simpler way to configure output to a ram disk? Perhaps some trick with the Maven POM file?
By comparison, this approach is used by many iOS/macOS developers using Xcode who divert their DerivedData folder to a RAM disk to speed up the compiling process.

Related

Using intellij to modify/build/index code base on remote system

I have 2 machines to work upon. One is my macbook pro which I prefer for development purpose and another is a remote machine where I do majority of my testing by building the code base and bootstrapping the application.
Is there a way by which I can configure intellij on my mac to point the code base in remote machine so that Intellij can easily identify the project structure and build artefacts there? By this way I am assuming that intellij will not build the code base locally, rather it will just index already build files and help me in modifying the code base.
IntelliJ IDEA has no support for that at the moment.

How to speed up deploying time of jar in a remote server?

Every time I want to test a java project written with Eclipse IDE I need to upload the .jar file (which is heavy) to a Testing Environment via SSH and that process takes almost 15 minutes. It's uncomfortable to test any piece of code there because I have to wait that specific amount of time. The problem is that the upload speed cannot be increased (it belongs to the client). How can I reduce my deployment time for this kind of task?
Testing Server: Red Hat Enterprise Linux Server release 6.5
Is Jar contains embedded appserver like tomcat or it is deployed to application library path ?
If you can de-compose the module & split into another jar (as jar creation is in your scope) it might help you to create small jar so that you can transfer the jar quickly.

Intellij IDEA generating html y jnlp for java fx artifact

Why when I'm generating an artifact for a javafx application using Intellij IDEA, besides the .jar, it generates a .html and a .jnlp file?, are those two necessary for the application to work, if not is there a setting I can change in order to don't create those anymore?
Files Required for Various JavaFX Execution Modes
it generates a .html and a .jnlp file?, are those two necessary for the application to work
The files required for deployment depend on the execution mode of your application.
If your application is embedded in a browser (e.g. executes via the Java plugin like a traditional Java applet), then you require all of the .html, .jnlp and .jar files.
If your application is launched from a browser via Webstart using the Java deployment toolkit, then you require all of the .html, .jnlp and .jar files.
If your application is launched via Webstart from a web page via a direct href link to the jnlp file, then you only need the .jnlp and .jar file.
If your application is distributed as a "standalone program" (e.g. "Users launch it using a Java launcher, such as java -jar MyApp.jar, or by double-clicking the application JAR file."), then you only need the .jar file.
If your application is distributed as a "self-contained" application then you need none of the .jnlp, .html or .jar files, as everything required to run your application will be packaged into a native install package (e.g. .rpm, .msi, .deb, .dmg) that you will distribute.
Suggested Approach
As you will be using the "standalone program" form of distribution, you only require the .jar file for distribution and can ignore other files created by the Java packaging tools.
While you could have Idea package your application as a JAR by choosing Build | Build Artifacts | Edit... | + | JAR | From modules with dependencies..., I don't recommend that as you will also need to set a main class in the manifest and will lose some of the functionality of files which are packaged using Idea's "JavaFX Application" packaging type, such as in-built detection that the Java runtime used to launch the application meets minimum requirements to run JavaFX applications and transparent network proxy support.
So instead, just use, unchanged, the Idea artifact packaging configuration that you have already setup. Ignore the .html files and .jnlp files output. Just distribute the .jar file to your users along with instructions on how to launch it either via java -jar MyApp.jar or double-clicking the .jar after a Java runtime has been installed on their machine.
Portable Build Advice
If it is only you developing the project and you are unfamiliar with external build tools such as maven or gradle, then it is (probably) simpler to use the artifact packaging features built into your Idea IDE rather than to learn and use external tools.
If your project might potentially be worked on by other developers or builds are to be produced and tested within a continuous integration system such as Jenkins, I do not recommend relying on IDE specific build systems such as the artifact packager in Idea. Instead, use an external build tool such as maven or gradle. There is a maven plugin and a gradle plugin for JavaFX build.

IntelliJ 14.1 is too slow when I import a Maven project

If I import a Maven project (Import Project > choose the main pom.xml file > check Import Maven projects automatically > Next ...):
in IntelliJ IDEA 14.1 Ultimate Edition it takes about 5 hours until is ready.
in IntelliJ IDEA 14.0.3 Ultimate Edition it was about 20 times faster.
During the processing, if I maximize a popup it looks like:
The modules (folders) in the Project area are shown only at the end (only the files from the main directory are shown during the "resolving" - in this case immediately).
The jar files are already in the .m2 folder, so the problem is not related to the time for downloading those jars.
Is there a "hidden" setting needed to improve the performance? (a check box, a command, etc.)
Details:
Windows 7
Java 7
Apache Maven 3.2.1
Edit:
JDK, Maven, .m2, IntelliJ IDEA and the project sources are on the same drive
JetBrains wrote:
Your projects open faster and the IDE is more responsive as some processes now run in the background.
regarding IntelliJ IDEA 14.1 and probably it is faster but (at least for me) not using the default settings.
If you use the bundled Maven that comes with Idea 14.1, have a look here: Slow Intellij IDEA deployment . Using an installed Maven seems to be much faster.
Another improvement could be to change the JDK for importer (and probably the VM options for importer) from Use internal JRE to your own JDK:
It's all because Maven version. Maven 3.0.5 or Maven 2.x use simplified dependency resolution so often it can be used during import for big projects. Thought it can work incorrect for some projects which uses 3.1+ Maven.
Switching off auto-importing is another solution.

Play Framework 2.1 application mounted as an IntelliJ Module

Known is the command to create IntelliJ files needed for a Play application:
play idea with-sources=yes
This generates two folders:
.idea (containing libraries.xml)
.idea_modules
Most of tutorials or simple article on the net explain how to mount the app as an IntelliJ Project.
However, I want to mount it as a Module (as part of an existing project so), thus I've just used the .idea_modules file.
I can't imagine me setting ALL dependencies (more than 100...) manually...
How to deal with the libraries (dependencies)? Indeed, libraries.xml is used in .idea file and typically used when someone want to mount the app as an entire Project.
To put in a nutshell, is there an efficient way to set up a Play app in IntelliJ as a simple Module including automatically all needed dependencies?
It would be great if IntelliJ could implement an SBT feature like the one for Maven in order to import dependencies automatically.