Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6854047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:35:07+00:00 2026-05-27T01:35:07+00:00

I want to switch my Maven2 build file to gradle. Generating the java classes

  • 0

I want to switch my Maven2 build file to gradle.
Generating the java classes from WSDL + XSDs with gradle seems to be not documented further there is no gradle plugin for this.
I use the following configuration with maven and search the equivalent for gradle.

<!-- plugin for generating the classes from the WSDL+XSD -->
<plugin>
  <groupId>org.jvnet.jaxb2.maven2</groupId>
  <artifactId>maven-jaxb2-plugin</artifactId>
  <version>0.7.3</version>
  <executions>
    <execution>
      <id>app1-stub-generation</id>
      <goals>
        <goal>generate</goal>
      </goals>
      <configuration>
        <schemaDirectory>${project.build.directory}/wsdl/app1</schemaDirectory>
        <schemaIncludes>
          <include>*.xsd</include>
        </schemaIncludes>
        <generatePackage>org.app1.ws.generated</generatePackage>
        <generateDirectory>${project.build.directory}/generated-sources/app1</generateDirectory>
        <strict>true</strict>
      </configuration>
    </execution>
    <execution>
      <id>app2-v1-stub-generation</id>
      <goals>
        <goal>generate</goal>
      </goals>
      <configuration>
        <schemaDirectory>src/main/resources/wsdl</schemaDirectory>
        <schemaIncludes>
          <include>v1/*.xsd</include>
        </schemaIncludes>
        <generatePackage>org.app2.ws.generated.v1</generatePackage>
        <generateDirectory>${project.build.directory}/generated-sources/v1</generateDirectory>
        <strict>true</strict>
      </configuration>
    </execution>
    <execution>
      <id>app2-v2-stub-generation</id>
      <goals>
        <goal>generate</goal>
      </goals>
      <configuration>
        <schemaDirectory>src/main/resources/wsdl</schemaDirectory>
        <schemaIncludes>
          <include>v2/*.xsd</include>
        </schemaIncludes>
        <generatePackage>org.app2.ws.generated.v2</generatePackage>
        <generateDirectory>${project.build.directory}/generated-sources/v2</generateDirectory>
        <strict>true</strict>
      </configuration>
    </execution>
  </executions>
</plugin> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:35:08+00:00Added an answer on May 27, 2026 at 1:35 am

    i solved it…

    configurations {
        jaxb
    }
    
    dependencies {
        jaxb group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.2.4-1'
    }
    
    task jaxb () {
        // output directory
        jaxbTargetDir = file( "${buildDir}/generated-sources" )
        jaxbTargetDirV19 = file( jaxbTargetDir.path + '/v19' )
        jaxbTargetDirV110 = file( jaxbTargetDir.path + '/v110' )
        jaxbTargetDirOtherWs = file( jaxbTargetDir.path + '/otherWs' )
    
        // perform actions
        doLast {
            jaxbTargetDirV19.mkdirs()
            jaxbTargetDirV110.mkdirs()
            jaxbTargetDirOtherWs.mkdirs()
    
            ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.jaxb.asPath)
            ant.jaxbTargetDirV19 = jaxbTargetDirV19
            ant.jaxbTargetDirV110 = jaxbTargetDirV110
            ant.jaxbTargetDirOtherWs = jaxbTargetDirOtherWs
    
            // My-Webservice v1.10
            ant.xjc(
                    destdir: '${jaxbTargetDirV110}',
                    package: 'mypackage.ws.generated.v110',
                    schema: 'src/main/resources/wsdl/v1.10/MyServiceSchema.xsd'
            )
    
            // My-Webservice v1.9
            ant.xjc(
                    destdir: '${jaxbTargetDirV19}',
                    package: 'mypackage.ws.generated.v19',
                    schema: 'src/main/resources/wsdl/v1.9/MyServiceSchema.xsd'
            )
    
            // OtherWs-Webservice
            ant.xjc(
                    destdir: '${jaxbTargetDirOtherWs}',
                    package: 'mypackage.otherws.generated',
                    schema: 'src/main/resources/wsdl/OtherWsServiceSchema.xsd'
            )
        }
    }
    compileJava.dependsOn jaxb
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to switch from Java to a scripting language for the Math based
I want to switch to Java 1.6 from 1.5 but I think it's better
I want to switch from the index.html file to a second html file called
I want to Switch from Web Designer to Front End Developer or web developer
I want to switch over to Mono from .Net (plus Visual Studio to whatever
I've got two SVN branches (eg development and stable) and want to switch from
I am a happy BASH user. I do not want to switch to another
I have a PHP application that I want to switch from MySQL to Cache
utilising xcode using the random function i want to switch to from a view
I want to learn Java and Linux. Java itself (as a language) is not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.