Skip to content

[Java][RESTEasy] Gradle build failed while maven build succeeded #5925

Closed
@wing328

Description

@wing328
Description

Gradle build failed for Java RESTEasy Petstore sample while mvn test works fine. Here are the steps to repeat it:

swagger-codegen|master⚡ ⇒ cd samples/client/petstore/java/resteasy
resteasy|master⚡ ⇒ gradle test
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:36: error: package org.jboss.logging does not exist
import org.jboss.logging.Logger;
                        ^
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:37: error: package org.jboss.resteasy.client.jaxrs.internal does not exist
import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration;
                                               ^
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:38: error: package org.jboss.resteasy.plugins.providers.multipart does not exist
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
                                                     ^
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:39: error: package org.jboss.resteasy.spi does not exist
import org.jboss.resteasy.spi.ResteasyProviderFactory;
                             ^
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:445: error: cannot find symbol
      MultipartFormDataOutput multipart = new MultipartFormDataOutput();  
      ^
  symbol:   class MultipartFormDataOutput
  location: class ApiClient
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:445: error: cannot find symbol
      MultipartFormDataOutput multipart = new MultipartFormDataOutput();  
                                              ^
  symbol:   class MultipartFormDataOutput
  location: class ApiClient
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:649: error: cannot find symbol
    final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance());
          ^
  symbol:   class ClientConfiguration
  location: class ApiClient
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:649: error: cannot find symbol
    final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance());
                                                 ^
  symbol:   class ClientConfiguration
  location: class ApiClient
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:649: error: cannot find symbol
    final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance());
                                                                     ^
  symbol:   variable ResteasyProviderFactory
  location: class ApiClient
/Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java:652: error: cannot find symbol
      clientConfig.register(Logger.class);
                            ^
  symbol:   class Logger
  location: class ApiClient
Note: /Users/williamcheng/Code/swagger-api/swagger-codegen/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
10 errors
1 warning
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.804 secs

sbt test also failed.

Swagger-codegen version

Latest master.

Suggest a Fix

If anyone wants to work on this issue, please reply to let us know and I can show you some good starting points.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions