How to create a project from the commandline? - intellij-idea

Is it possible to create an IntelliJ project purely from the command line?
We are looking a streamlining the on-boarding of new hires and off-shore resources and to minimise the amount of project setup they have to perform. As such, it would be nice if we had the IDE already configured for them to get started.

There is a legacy plug-in for Maven to generate IntelliJ IDEA project files, but we don't recommend using it.
Instead, it would be easier to instruct users to open pom.xml file in the IDE so that the import is performed automatically.

Related

intellij hybris class recompile not working

I installed hybris plugin.
Imported project with it.
Have done ant clean all.
Then, if I try to build->recompile class it's not working. Seems like idea doesn't see classes generated by ant.
If I do build->rebuild project and then build->recompile class it's working fine, but it's not convenient at all. I believe there is fix to this, but I couldn't find it.
This is usual error I've got(packages are different for different cases):
this is essentially the expected behaviour. You can't mix "ant" build
and "native IDEA" build. Those are two separate build systems.
This is an explanation of hybris plugin developer (hybris-integration.atlassian.net/browse/IIPS-120)
And he suggests a solution for that:
before you try to import the project you need to do ant clean all (you will not need to use ant afterwards)
import the project using hybris plugin.
Press Build->Recompile project
Then you can create or modify your test run configuration if needed.
Recompile your classes and so on directly in Idea.
Also, he mentioned deal with JRebel here (hybris-integration.atlassian.net/browse/IIPS-47)
we support both compilation modes. Ant targets and idea internal. They
shouldn't be mixed as idea has it's own compilation model/cache. If
you use idea compilation then you can use JRebel or hotswap.
You cant hotswap classes in hybris without the help of a hotswap agent.There is a tool available in the market called JRebel. It is a good commercial tool if one can afford. However, if you are an open-sourcist, there is a promising alternative to JRebel, which is DCEVM (Dynamic Code Evolution Virtual Machine) along with HotswapAgent.
I don't know if this help,
you can start another cmd console, and run
setantenv and ant build to hotswap class in runtime.

Configure IntelliJ project when importing when importing a Gradle project

Is there a way to import a Gradle Java project into IntelliJ 2017.2.x and apply some settings like
code style
vcs settings
from the Gradle build.gradle on project level?
I noticed that e.g. the Grails Framework uses the idea-gradle-plugin but this only works in combination with the Gradle task idea.
gradlew idea
I don't want to generate IntelliJ project files using a Gradle task. I would like IntelliJ to fetch the settings from the build file whenever I import the build.gradle file.
Is this possible?
Afaik no. You can only set in build.gradle what is supported by the DSL that then also is understood by the IDEA integration. There is no way to set arbitrary settings this way.
To do this, as you already found out, you need to hook into the IDEA project file generation and generate the settings you want like code style settings and VCS settings (I do both for our projects and more) and then use the idea task to generate the project files.
You can also configure IDEA to automatically run some Gradle task before refreshing the project, so you can make IDEA automatically run the idea task before refreshing and this should work then. The initial IDEA setup to do this though has either to be generated with idea, set-up manually by all devs or configured once and then checked in. But if you check-in the IDEA files, you can of course also simply check-in the code-style and VCS settings. Most of the IDEA project files are meant to be checked in anyway. Just some like the workspace file are meant to be developer-specific and thus excluded from being checked in.

how to add gradle (ideally using kotlin-dsl) to existing intellij python project

There are some quite useful previous questions (especially this one but it is out of date and not a direct answer.
We have several python projects but are not moving into the world of kotlin. I am looking to unify tools somewhat by introducing gradle to automate tasks within python projects.
I have added a working sample kotlin-dsl gradle script that automates the tasks successfully when launched from a shell, but where I am blocked is adding support for this to the intellij IDE.
The first challenge is simply configuring a python project to add gradle (currently gradle does not even appear on the tool windows menu. I am thinking the python module can have python support allowing the overall project to have the jvm as this will be needed by gradle. But what to do switch intellij to recognise the allready working build.gradle.kts file in the project root folder so tasks can be launced through the IDE and not just the shell?
Note: python dependancy support is not required at this time (as per the linked in).
Assistance appreciated.

How to run ant file in JetBrains WebStorm IDE?

I want to migrate from Eclipse to WebStorm for front end programming. I have done a setup for WebStorm but I couldn't find the way to do:
Ant view - I couldn't find Ant view to run Ant files
File synchronizer - to synchronize the code from Eclipse editor to actual working domain folder, I used to use file synchronizer. For WebStorm - I have found remote file synchronizer plugin but either I am not able to use it or it is meant for something else.
Any help on these would be highly appreciated!!
Also, I used to work on multiple projects simultaneously. Is there any way in WebStorm to use multiple projects in same view (without opening different windows)? If it is not feasible to do these things in WebStorm please guide me to choose good IDE for frontend programming.

How do you link an eclipse project to an eclipse plug-in project?

I am building an eclipse plug-in project that acts as a front end. I also have a separate eclipse project that runs as a backend. Right now I can run each of them separately and they communicate just fine using sockets.
I would like the plug-in to create the major components of the back end when it starts but also keep the two projects separate so that I can use other editors to communicate with the back end. So, I added the back end eclipse project to the build properties of the plug-in project and I added some code from the back end driver to the plug-in activator's start(). However, when I run the plug-in project I am getting class not found exceptions for all back end references. It appears to compile fine, but I can't run it. I do not do anything to the MANIFEST.MF file in the plug-in project.
How does one add a second java project to an eclipse plug-in project?
There are several ways you can do this, going from best and most difficult to worst and easiest:
(1) Use a build tool (such as the built-in ANT, or tycho, or (as I'm sure there are) some other). This is by far the best solution, but is quite a bit more involved than the next 2.
(2) Convert your non-plugin project to a plugin project and add it as a plugin dependency in your plugin settings file's dependencies tab
(3) Export your non-plugin to a new .jar in your plugin project directory (e.g. $project_loc/lib/something.jar); go into plugin settings (plugin.xml) and include it in: The Build tab under binary build, and the Runtime tab under Classpath. (Or edit the corresponding entries in manifest.mf and build.properties)
For most cases I'd recommend approach (1); look up a few tutorials online, there are plenty. (3) is the quick-and-dirty non-flexible workaround to your particular situation, good for nothing other than seeing if it actually can run. (2) is somewhere in between -- obviously not ideal, but not as bad as 3.