Intellij IDEA中的mapstruct和gradle configuratoin问题 [英] mapstruct and gradle configuratoin issue in Intellij IDEA

查看:5081
本文介绍了Intellij IDEA中的mapstruct和gradle configuratoin问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用gradle的项目,并将mapstruct作为依赖项之一。每次我试图建立项目,都失败了。我想这是因为Mapstruct将生成gradle无法找到的impl类。谁能帮助我如何在intellij IDEA中配置它?

I have a project using gradle, and have mapstruct as one of dependency. everytime I tried to build project, it failed. I guess it is because Mapstruct will generate impl class that gradle was not able to find. Can anyone help me how to configure this in intellij IDEA?

谢谢

推荐答案

这对我有用

在intellij IDEA中转到

In intellij IDEA go to

文件|设置|构建,执行,部署|构建工具| Gradle | Runner

File | Settings | Build, Execution, Deployment | Build Tools | Gradle | Runner

启用委托IDE构建/运行操作。
参考: - https://www.jetbrains.com/ idea / whatsnew /#v2016-3-gradle

Enable Delegate IDE build/run actions. Ref :- https://www.jetbrains.com/idea/whatsnew/#v2016-3-gradle

在build.gradle中

In build.gradle

buildscript {
    ...    
}
plugins {
    id 'net.ltgt.apt' version '0.9'
}

apply plugin: 'idea'
apply plugin: "net.ltgt.apt"

dependencies {
    ...
    compile 'org.mapstruct:mapstruct-jdk8:1.1.0.Final'
    apt 'org.mapstruct:mapstruct-processor:1.1.0.Final'
}

添加此配置后运行项目,您可以在build / generated文件夹中看到生成的文件

After Adding this configuration Run your project you can see your generated files in build/generated folder

这篇关于Intellij IDEA中的mapstruct和gradle configuratoin问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆