New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellij support #520

Closed
mdeinum opened this Issue Mar 27, 2015 · 12 comments

Comments

Projects
None yet
7 participants
@mdeinum

mdeinum commented Mar 27, 2015

Would be nice if there would also be IntelliJ IDEA support.

JetBrains issue is IDEA-138364 add some votes then it might be picked up.

@agudian

This comment has been minimized.

Show comment
Hide comment
@agudian

agudian Mar 27, 2015

Member

Great, thanks for opening up that issue in the JetBrains tracker. I've placed my vote. 👍

We already have an Eclipse plugin in the works (with code-completion for source/target, more features to come).

In case JetBrains doesn't create such a plugin, maybe you'd like to bootstrap one yourself here with us?

Member

agudian commented Mar 27, 2015

Great, thanks for opening up that issue in the JetBrains tracker. I've placed my vote. 👍

We already have an Eclipse plugin in the works (with code-completion for source/target, more features to come).

In case JetBrains doesn't create such a plugin, maybe you'd like to bootstrap one yourself here with us?

@krishna81m

This comment has been minimized.

Show comment
Hide comment
@krishna81m

krishna81m Sep 25, 2015

We see an issue with Tomcat plugin, it packages all generated resources correctly in right package in WAR but when doing a local debug, these generated sources are not available. This is only with IntelliJ. Is anybody aware of this issue?

The obvious hack is to add the generated sources class to the plugin classpath.

krishna81m commented Sep 25, 2015

We see an issue with Tomcat plugin, it packages all generated resources correctly in right package in WAR but when doing a local debug, these generated sources are not available. This is only with IntelliJ. Is anybody aware of this issue?

The obvious hack is to add the generated sources class to the plugin classpath.

@thekalinga

This comment has been minimized.

Show comment
Hide comment
@thekalinga

thekalinga Mar 14, 2017

After migrating to the latest versions of lombok & mapstruct, intellij throws duplicate class error.

Here are the steps to reproduce the error.

  1. Run ./gradlew clean compileJava from terminal
  2. Debug spring boot application from Intellij

You would get a duplicate class error.

This is because intellij is creating its own version of generated source under build/classes/main/generated, but the gradle plugin (from terminal) is generating the same source under build/generated/ & registering this path as a source in intellij.

This is causing Intellij to find another class with the same name under the same package when it tries to compile, so it bailing out saying there is a duplicate class.

Temp work around for this problem is to do a ./gradlew clean & dont run gradle compileJava task from terminal.

Now if you try to debug, intellij will continue to generate the source in its default location & since we dint run compileJava from terminal, it finds only one source in its source paths.

thekalinga commented Mar 14, 2017

After migrating to the latest versions of lombok & mapstruct, intellij throws duplicate class error.

Here are the steps to reproduce the error.

  1. Run ./gradlew clean compileJava from terminal
  2. Debug spring boot application from Intellij

You would get a duplicate class error.

This is because intellij is creating its own version of generated source under build/classes/main/generated, but the gradle plugin (from terminal) is generating the same source under build/generated/ & registering this path as a source in intellij.

This is causing Intellij to find another class with the same name under the same package when it tries to compile, so it bailing out saying there is a duplicate class.

Temp work around for this problem is to do a ./gradlew clean & dont run gradle compileJava task from terminal.

Now if you try to debug, intellij will continue to generate the source in its default location & since we dint run compileJava from terminal, it finds only one source in its source paths.

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr Mar 14, 2017

Member

@thekalinga this looks like a problem with your IntelliJ setup (or a bug in IntelliJ). Check your settings under Build, Execution, Deployment -> Compiler -> AnnotationProcessors

For me with Maven and the IntelliJ 2017.1 EAP (171.3780.15) it works.

Member

filiphr commented Mar 14, 2017

@thekalinga this looks like a problem with your IntelliJ setup (or a bug in IntelliJ). Check your settings under Build, Execution, Deployment -> Compiler -> AnnotationProcessors

For me with Maven and the IntelliJ 2017.1 EAP (171.3780.15) it works.

@thekalinga

This comment has been minimized.

Show comment
Hide comment
@thekalinga

thekalinga Mar 15, 2017

I'm using IntelliJ IDEA 2016.3.5, not EAP. Not sure if this the culprit/there is an issue with gradle builds.

thekalinga commented Mar 15, 2017

I'm using IntelliJ IDEA 2016.3.5, not EAP. Not sure if this the culprit/there is an issue with gradle builds.

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr Aug 9, 2017

Member

I have started working on a plugin for IntelliJ. mapstruct-idea is the name of the repository that you can watch and create issues for.

The plugin is not yet published as it is WIP. Currently there is only support for autocompletion for componentModel and rudimentary auto-completion and go to declaration for source and target. Feel free to open issues there with suggestion about what you want to see in the plugin.

Member

filiphr commented Aug 9, 2017

I have started working on a plugin for IntelliJ. mapstruct-idea is the name of the repository that you can watch and create issues for.

The plugin is not yet published as it is WIP. Currently there is only support for autocompletion for componentModel and rudimentary auto-completion and go to declaration for source and target. Feel free to open issues there with suggestion about what you want to see in the plugin.

@gimoh

This comment has been minimized.

Show comment
Hide comment
@gimoh

gimoh Aug 14, 2017

@filiphr what should the settings under Build, Execution, Deployment -> Compiler -> AnnotationProcessors be? I've enabled annotation processing in there, but it didn't seem to make a difference

do you also need to have builds delegated to Gradle in Build, Execution, Deployment -> Gradle -> Runner? (that seems to work for me although it's a bit slower)

gimoh commented Aug 14, 2017

@filiphr what should the settings under Build, Execution, Deployment -> Compiler -> AnnotationProcessors be? I've enabled annotation processing in there, but it didn't seem to make a difference

do you also need to have builds delegated to Gradle in Build, Execution, Deployment -> Gradle -> Runner? (that seems to work for me although it's a bit slower)

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr Aug 14, 2017

Member

@gimoh I don't understand what you mean. If you are talking about IntelliJ invoking the annotation processing with Gradle, then yes you need to delegate the build to Gradle in order to do that.

We are planning to update the website to put some more information about IntelliJ and Gradle integration. Have a look at mapstruct/mapstruct.org#63

Member

filiphr commented Aug 14, 2017

@gimoh I don't understand what you mean. If you are talking about IntelliJ invoking the annotation processing with Gradle, then yes you need to delegate the build to Gradle in order to do that.

We are planning to update the website to put some more information about IntelliJ and Gradle integration. Have a look at mapstruct/mapstruct.org#63

@gimoh

This comment has been minimized.

Show comment
Hide comment
@gimoh

gimoh Aug 16, 2017

@filiphr OK, I get it now, I thought that if you enable annotation processing in IntelliJ (Build, Execution, Deployment -> Compiler -> AnnotationProcessors) you don't need to delegate to Gradle

If you are delegating to Gradle, does annotation processing still need to be enabled in IntelliJ?

gimoh commented Aug 16, 2017

@filiphr OK, I get it now, I thought that if you enable annotation processing in IntelliJ (Build, Execution, Deployment -> Compiler -> AnnotationProcessors) you don't need to delegate to Gradle

If you are delegating to Gradle, does annotation processing still need to be enabled in IntelliJ?

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr Aug 16, 2017

Member

@gimoh if you are delegating to Gradle, the enabling of annotation processing in IntelliJ does nothing as IntelliJ will use Gradle to compile your code.

Enabling annotation processing in IntelliJ can theoretically work if you don't use the apt plugin, and you define the dependency in such way that IntelliJ can pick it up and see the processor.

Member

filiphr commented Aug 16, 2017

@gimoh if you are delegating to Gradle, the enabling of annotation processing in IntelliJ does nothing as IntelliJ will use Gradle to compile your code.

Enabling annotation processing in IntelliJ can theoretically work if you don't use the apt plugin, and you define the dependency in such way that IntelliJ can pick it up and see the processor.

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr Sep 19, 2017

Member

I am happy finally close this issue 😄.

We have released our plugin the the Jetbrains repository. Here is a link to our announcement and here is the link to the plugin.

Give it a go and feel free to give us feedback and suggestions into its own repository at mapstruct-idea

Member

filiphr commented Sep 19, 2017

I am happy finally close this issue 😄.

We have released our plugin the the Jetbrains repository. Here is a link to our announcement and here is the link to the plugin.

Give it a go and feel free to give us feedback and suggestions into its own repository at mapstruct-idea

@filiphr filiphr closed this Sep 19, 2017

@lex-em

This comment has been minimized.

Show comment
Hide comment
@lex-em

lex-em Sep 25, 2017

it is awesome!

lex-em commented Sep 25, 2017

it is awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment