Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7751

Codegen plugin can't work with empty extraarg tag

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.1.6, 3.2.4
    • 3.1.16, 3.2.5
    • Build system
    • None
    • Guru

    Description

       

      I use cxf codegen plugin and i have separate maven profile to generate code by wsdl. My problem in extraarg tag.

      i have soap connectors, that have pom where is configuration of codegen plugin. When project runnnig with generate code by wsdl profile ${wsdl.extraarg.keep} equal "-keep." And that good work.

      When runnig another maven profile my ${wsdl.extraarg.keep} don't initialize and in codegen in extraarg put emty  string " ".

      <plugin>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-codegen-plugin</artifactId>
          <version>3.1.6</version>
          <executions>
              <execution>
                  <id>generate-sources</id>
                  <phase>generate-sources</phase>
                  <configuration>
                      <sourceRoot>src/main/java</sourceRoot>
                      <wsdlOptions>
                          <wsdlOption>
                              <wsdl>
                                ../wsdl//ReferenceDataService.wsdl
                              </wsdl>
                              <extraargs> 
                                  <extraarg>${wsdl.extraarg.keep}</extraarg>
                              </extraargs>
                          </wsdlOption>
                      </wsdlOptions>
                      <encoding>UTF-8</encoding>
                  </configuration>
                  <goals>
                      <goal>wsdl2java</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      

      In result i have error.

       [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.1.6:wsdl2java (generate-sources) on project test-project: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:3.1.6:wsdl2java failed: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected argument: file:/C:/Projects/test/backend/soap-connectors/wsdl/ReferenceDataService.wsdl

      it's couse emppty is "The path and name of the WSDL file to use in generating the code."

       Okey. I cheat and use that: 

      <plugin>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-codegen-plugin</artifactId>
          <version>3.2.4</version>
          <executions>
              <execution>
                  <id>generate-sources</id>
                  <phase>generate-sources</phase>
                  <configuration>
                      <sourceRoot>src/main/java</sourceRoot>
                      <wsdlOptions>
                          <wsdlOption>
                              <wsdl>
                                ../wsdl//ReferenceDataService.wsdl
                              </wsdl>
                              <extraargs>
                                  <extraarg>../wsdl//ReferenceDataService.wsdl</extraarg> 
                                  <extraarg>${wsdl.extraarg.keep}</extraarg>
                              </extraargs>
                          </wsdlOption>
                      </wsdlOptions>
                      <encoding>UTF-8</encoding>
                  </configuration>
                  <goals>
                      <goal>wsdl2java</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>

      In result i have error "Unexpected argument" with empty string.

      [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.2.4:wsdl2java (generate-sources) on project test-project: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:3.2.4:wsdl2java failed: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected argument:

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dkulp Daniel Kulp
            Pushkin Sergey Pushkin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment