ciscoo / cxf-codegen-gradle

Gradle plugin to generate Java artifacts from WSDL
Apache License 2.0
26 stars 6 forks source link

Container names are not checked for validity #17

Closed ciscoo closed 3 years ago

ciscoo commented 3 years ago

Currently, there is no checking whatsoever of the name. So the following is valid:

cxfCodegen {
    wsdl2java {
        register("this should not-be allowed#$%") {
            wsdl.set(file("path/to/example.wsdl"))
        }
    }
}

But results in the following error from Gradle when the task is created:

 (...) must not contain any of the following characters: [/, \, :, <, >, ", ?, *, |].

Removing the invalid characters works:

cxfCodegen {
    wsdl2java {
        register("this should not-be allowed") {
            wsdl.set(file("path/to/example.wsdl"))
        }
    }
}

And task execution works when using the aggregate task:

./gradlew wsdl2java                 

> Task :wsdl2javaThis should not-be allowed

BUILD SUCCESSFUL in 2s

However, you are not able to execute the task directly which is named: wsdl2javaThis should not-be allowed:

./gradlew wsdl2javaThis should not-be allowed

FAILURE: Build failed with an exception.

* What went wrong:
Task 'should' not found in root project