IntershopCommunicationsAG / wsdl-gradle-plugin

Apache License 2.0
9 stars 14 forks source link

IntelliJ IDEA wrong generated source folder #31

Open freynder opened 1 year ago

freynder commented 1 year ago

First of all thank you for a great plugin.

The generated code appears in build/generated/wsdl2java/axis2/genMyNameAxis2/src . However IDEA recognizes build/generated/wsdl2java/axis2/genMyNameAxis2/ as source root folder (without the 'src' part). Works correctly in command line gradle though. Any idea why and what I could do about it? Thanks

freynder commented 1 year ago

I guess this is due to:

                                it.java.srcDir(this@apply.outputs)

in WSDLPlugin.kt not specifying the src subfolder (or Axis2 providing it in a different way). Assumption is that gradle java compilation does not require the package name to match the folder structure, while IntelliJ IDEA does for indexing. Gradle java plugin documentation also says the same: https://docs.gradle.org/current/userguide/java_plugin.html :

Having a source structure that does not match the package names, while legal for compilation, might end up causing trouble in the toolchain.
nguchakov commented 1 year ago

I have the same issue. Couldn't force IDEA to index generated files, even by adding directory to sourceSets manually

jagedn commented 6 months ago

my "workaround" is to run a doLast closure (I use Groovy dsl) to move the folder

tasks.getByName("axis2Wsdl2javaNif").doLast {
    ant.move(
            file:file('build/generated/wsdl2java/axis2/nif/src/es').absolutePath,
            tofile:file('build/generated/wsdl2java/axis2/nif/es').absolutePath
    )
}