[BUG] Cannot suppress "[WARNING] Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated." message.
Created by: krystalmonolith
Bug Report Checklist
- [n/a] Have you provided a full/minimal spec to reproduce the issue?
- [n/a] Have you validated the input using an OpenAPI validator
- [openapi-generator-maven-plugin:4.0.2] What's the version of OpenAPI Generator used?
- [yes] Have you search for related issues/PRs?
- [See Description] What's the actual output vs expected output?
Description
Everything in my application works i.e. the expected OpenAPI docs are working/visible... But
I don't know how to suppress the warning message (shown below) logged during my Maven builds that use the openapi-generator-maven-plugin:4.0.2:generate
Maven goal:
[WARNING] Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
I flailed around putting a .openapi-generator-ignore
file in my project root, etc. to no avail. It looks like it wants the Maven target
directory but I cannot tell from that message. The target
directory won't exist if the project has been cleaned.
Why this is labeled as a Bug:
1.) The warning appears redundant as everything works. Spurious warnings keep Maven users from using Maven's fail-on-warning capability. 2.) The code should anticipate situations where the output directory does not exist. 3.) The warning message does not say what directory is missing, frustrating any debugging attempt.
Code Location:
LOGGER.warn("Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.");
openapi-generator version
Maven Plugin: openapi-generator-maven-plugin:4.0.2
Maven Plugin Verbose Output: [WARNING] logged on eighth line.
[INFO] --- openapi-generator-maven-plugin:4.0.2:generate (default) @ myapp ---
[INFO]
VERBOSE MODE: ON. Additional debug options are injected
- [debugOpenAPI] prints the OpenAPI specification as interpreted by the codegen
- [debugModels] prints models passed to the template engine
- [debugOperations] prints operations passed to the template engine
- [debugSupportingFiles] prints additional data passed to the template engine
[WARNING] Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
[INFO] OpenAPI Generator: spring (server)
[INFO] Generator 'spring' is considered stable.
{
"openapi" : "3.0.1",
"info" : {
"title" : "MyApp",
"version" : "0.0.1"
},
"servers" : [ {
"url" : "http://localhost:8080",
"description" : "Development server"
}, {
"url" : "https://localhost:8080",
"description" : "Development server with TLS Profile"
} ],
"security" : [ {
"jwt" : [ ]
} ],
"paths" : { },
"components" : {
"schemas" : { },
"securitySchemes" : {
"jwt" : {
"type" : "http",
"description" : "JWT Authentication",
"scheme" : "bearer",
"bearerFormat" : "JWT"
}
}
}
}
[INFO] ----------------------------------
[INFO] Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE="/usr/local/bin/clang-format -i"' (Linux/Mac)
[INFO] NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
[INFO] Invoker Package Name, originally not set, is now derived from api package name: com.myorg.myapp.web
[INFO] ############ Model info ############
[ ]
[INFO] ############ Operation info ############
[ ]
[INFO] ############ Supporting file info ############
{
"appVersion" : "0.0.1",
"generatorClass" : "org.openapitools.codegen.languages.SpringCodegen",
"supportJava6" : false,
"groupId" : "org.openapitools",
"invokerPackage" : "com.myorg.myapp.web",
"apiFolder" : "com/myorg/myapp/web/api",
"developerEmail" : "team@openapitools.org",
"authMethods" : [ {
"name" : "jwt",
"type" : "http",
"scheme" : "bearer",
"hasMore" : false,
"isBasic" : true,
"isOAuth" : false,
"isApiKey" : false,
"isBasicBasic" : false,
"isBasicBearer" : true,
"bearerFormat" : "JWT",
"vendorExtensions" : { },
"isKeyInQuery" : false,
"isKeyInHeader" : false,
"isKeyInCookie" : false,
"isCode" : false,
"isPassword" : false,
"isApplication" : false,
"isImplicit" : false
} ],
"generateModelDocs" : true,
"generateModelTests" : true,
"generateApiTests" : true,
"generateModels" : true,
"serializableModel" : false,
"inputSpec" : "/home/user/dev/MyApp/src/main/resources/swagger/api.yml",
"host" : "localhost",
"artifactUrl" : "https://github.com/openapitools/openapi-generator",
"developerOrganization" : "OpenAPITools.org",
"delegatePattern" : true,
"models" : [ ],
"hasBearerMethods" : true,
"fullJavaUtil" : false,
"lambdaRemoveLineBreak" : { },
"openapi-yaml" : "openapi: 3.0.1\ninfo:\n title: MyApp\n version: 0.0.1\nservers:\n- description: Development server\n url: http://localhost:8080\n- description: Development server with TLS Profile\n url: https://localhost:8080\nsecurity:\n- jwt: []\npaths: {}\ncomponents:\n schemas: {}\n securitySchemes:\n jwt:\n bearerFormat: JWT\n description: JWT Authentication\n scheme: bearer\n type: http\n",
"configPackage" : "org.openapitools.configuration",
"basePackage" : "org.openapitools",
"appDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
"contextPath" : "",
"hasAuthMethods" : true,
"javaUtilPrefix" : "",
"licenseName" : "Unlicense",
"releaseNote" : "Minor update",
"version" : "0.0.1",
"apiInfo" : {
"apis" : [ ]
},
"modelDocPath" : "docs/",
"withXml" : false,
"lambdaEscapeDoubleQuote" : { },
"scmDeveloperConnection" : "scm:git:git@github.com:openapitools/openapi-generator.git",
"useNullForUnknownEnumValue" : false,
"licenseUrl" : "http://unlicense.org",
"isDelegate" : "true",
"jsr310" : "true",
"generatedYear" : "2019",
"modelPackage" : "com.myorg.myapp.web.api.model",
"openAPI" : {
"openapi" : "3.0.1",
"info" : {
"title" : "MyApp",
"version" : "0.0.1"
},
"servers" : [ {
"url" : "http://localhost:8080",
"description" : "Development server"
}, {
"url" : "https://localhost:8080",
"description" : "Development server with TLS Profile"
} ],
"security" : [ {
"jwt" : [ ]
} ],
"paths" : { },
"components" : {
"schemas" : { },
"securitySchemes" : {
"jwt" : {
"type" : "http",
"description" : "JWT Authentication",
"scheme" : "bearer",
"bearerFormat" : "JWT"
}
}
}
},
"scheme" : "http",
"sourceFolder" : "src/main/java",
"javaVersion" : "1.8",
"apiDocPath" : "docs/",
"generateApis" : true,
"title" : "my-app",
"serverPort" : "8080",
"basePathWithoutHost" : "",
"useSpringfox" : true,
"developerOrganizationUrl" : "http://openapitools.org",
"jackson" : true,
"servers" : [ {
"url" : "http://localhost:8080",
"description" : "Development server",
"variables" : [ ]
}, {
"url" : "https://localhost:8080",
"description" : "Development server with TLS Profile",
"variables" : [ ]
} ],
"java8" : "true",
"jdk8" : true,
"useBeanValidation" : true,
"artifactId" : "openapi-spring",
"artifactDescription" : "OpenAPI Java",
"hideGenerationTimestamp" : false,
"disableHtmlEscaping" : false,
"developerName" : "OpenAPI-Generator Contributors",
"scmConnection" : "scm:git:git@github.com:openapitools/openapi-generator.git",
"configOptions" : [ {
"modelPackage" : "com.myorg.myapp.web.api.model"
}, {
"title" : "myapp"
}, {
"apiPackage" : "com.myorg.myapp.web.api"
}, {
"delegatePattern" : "true"
} ],
"unescapedAppDescription" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
"templatingEngine" : "mustache",
"artifactVersion" : "0.0.1",
"appName" : "MyApp",
"generateApiDocs" : true,
"generatorVersion" : "4.0.2",
"performBeanValidation" : false,
"apiPackage" : "com.myorg.myapp.web.api",
"scmUrl" : "https://github.com/openapitools/openapi-generator",
"hasServers" : true,
"basePath" : "http://localhost:8080",
"gitRepoId" : "GIT_REPO_ID",
"booleanGetterPrefix" : "get",
"generatedDate" : "2019-11-27T12:45:14.624-07:00[America/Denver]",
"appDescriptionWithNewLines" : "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
"gitUserId" : "GIT_USER_ID"
}