How to independent run the intellij plugin in multiple project?(intellij plugin develop) - intellij-idea

i have rewrite the intellij plugin: MyBatis Log Plugin.
The plugin feature is restore the mybatis generate sql to original whole executable sql.
And i have open the source on github:
MyBatis Log Plugin
I want run this plugin on every different project independent.
But now i have a problem can't to solve.
When i enable the plugin, it only take effect on the last start. and output the whole sql on the last console.
How can i fix this bug?
Anyone who can help me to review the code and points out the problem.
Thank you!
And when i fix this bug, i will redistribution it on jetbrains plugin repository.

I hava solve my problem.
Every project i had new ConsoleView Object.
And output the log bind the project consoleView.

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.

IntelliJ IDEA: Unable to create a Gradle project

I'm facing difficulties in setting up a gradle project. During setting up of the Gradle settings in the wizard,
I am not able to use the default recommended gradle wrapper because it downloads the Gradle and the network connectivity is very bad. So I go with the local gradle distribution which I have installed in my Ubuntu. On refreshing of the gradle project after creation, I always get stuck to this error. When I run the gradle build command through the terminal on the empty project, It works fine.
I have also tried the troubleshooting solutions given by the IDE. But, that made no improvements. Need assistance to solve this problem.
Comment if any additional info required.
As no-one else has chipped in, an approach that should work is to use the Gradle Idea Plugin instead of relying on the build in support Gradle in Idea. In my experience the plugin supports a wider range of Gradle project structures than Ideasupports directly. So you would
Create a Gradle project outside Idea and confirm it all works on from the command line.
Add the Idea plugin to the project
Run 'gradle cleanIdea idea' to generate the Idea project files.
Open up the newly generated project files from Idea and off you go.

Looking for a MyBatis plugin for IntelliJ Idea 14

I'm looking for a current MyBatis plugin for IntelliJ Idea 14. I previously used one hosted by Seventh7 but that is no longer listed (and its git is a 404). The main thing I'm looking for is decent linking between my classes that extend SqlSessionDaoSupport (my DAO classes) and their matching xml files (not using annotation driven).
Any suggestions?
As far as I know the latest free version was v2.34 and it was applied to IDEA v141.177 till v141.179 (as described in file plugin.xml inside jar). That's why this plugin is no listed in IDEA. After this author released paid version and closes free access to the repo
But there is a free fork here:
https://github.com/phoenix/intellij-mybatis-plugin (I love github and open source :) )
Short instruction how to install it:
Download intellij-mybatis-plugin.jar from repo above or use direct link
In IDEA: File>Settings>Plugins, press button "Install plugin from disk" and select downloaded jar.
Restart IDEA
Note: For me navigation to and from xml files does not work until I disabled another iBatis plugin
In Intellij, Go to Settings-->Plugin-->Browse repositories
Search for mybatis plugin.
Install it and restart.
there is a plugin named MyBatisCodeHelperPro, you can search it in repositories.
or download via https://github.com/gejun123456/MyBatisCodeHelper-Pro/blob/master/README_EN.md

IntelliJ 12 + Gradle 1.3 - Basic Gradle syntax seems non-functional

I am attempting to play around with Gradle integration in IntelliJ Idea (Ultimate) v12.
It seems even if $GRADLE_HOME is configured properly, basic syntax such as 'apply', 'dependencies', etc. is not recognized.
I would seem like the solution should be something simple. Any help is appreciated.
IntelliJ IDEA doesn't currently offer syntax completion for Gradle build scripts. All you get is the standard Groovy support.
I was having the same problem until this morning. I did the following steps and it solved itself:
added the root build.gradle file (we have several) to the JetGradle tab and refreshed
updated to IDEA 12.0.1 (it restarts and reindexes)
I think doing the first one and restarting may be enough, but I'm not sure.
I'm using Intellij 13 and have had similar problems. What I noticed was, creating a new Project from Intellij (i.e. new Groovy Project or Gradle project), I get the syntax error markers. I also have noticed it didn't do a good job pulling in Gradle dependencies.
On the other hand, if I Import a Project through an already created build.gradle file, the syntax error markings go away and the dependencies seem to play more nicely. Not sure if this works for you.
With Intellij 14 and Gradle 2.3 I found that adding {$GRADLE_HOME}/lib and {$GRADLE_HOME}/lib/plugins as libraries in my project settings got rid of all the warnings like "dependencies cannot be applied to groovy.lang.Closure".

How to resolve a conflict in JetGradle on IntelliJ IDEA 11.1.2?

I am new to the Gradle integration JetGradle in IntelliJ IDEA 11.1.2 and currently I ran into a conflict with a compile time dependency.
Currently I do not know how to solve this conflict since IDEA does not provide me more informations than this little screenshot. Do you ran into a similar problem and were able to fix it? Any hints are appreciated.
Update: I have found out that IntelliJ IDEA is somehow unable to attach the joda-time-2.1.jar to the joda-time-2.1 library .
If I then manually add the JAR the conflict is successfully resolved. Is there a way IntelliJ can tell my why it does not add the JAR?
Yes, the problem is that the library is defined either in gradle or IDE but the jar is not attached to it at the IDE side.
AFAI there is no GUI at the IDE side that helps to resolve this situation. Please create a dedicated feature request at the tracker.
Denis