Skip to content

switch maven to gradle#777

Closed
jiahut wants to merge 6 commits into
iluwatar:masterfrom
jiahut:master
Closed

switch maven to gradle#777
jiahut wants to merge 6 commits into
iluwatar:masterfrom
jiahut:master

Conversation

@jiahut
Copy link
Copy Markdown

@jiahut jiahut commented Jul 30, 2018

switch the build tool from maven to gradle

the pom.xml is verbose

@npathai
Copy link
Copy Markdown
Contributor

npathai commented Aug 8, 2018

@iluwatar Switching to gradle should be a good step forward. What are your thoughts?

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Sep 2, 2018

@npathai while I don't have anything bad to say about Maven I think Gradle is the more modern build solution. Great comparison available at https://gradle.org/maven-vs-gradle/. I think we can do the switch after a thorough review.

@iluwatar
Copy link
Copy Markdown
Owner

@jiahut there are some conflicts that should be resolved

@iluwatar iluwatar self-requested a review October 13, 2018 15:10
@iluwatar iluwatar self-assigned this Oct 13, 2018
@jiahut
Copy link
Copy Markdown
Author

jiahut commented Oct 17, 2018

@iluwatar had updated the code, there is no problem performing the following build locally

gradle build test -x :serverless:test -x :naked-objects:naked-objects-integtests:test

up to now the :serverless module and the :naked-to-objects:naked-to-integtests module might use some of the maven plug-ins and need to be fixed.

But the travis-ci lose with apt-get install failed,it is confusing.

@iluwatar
Copy link
Copy Markdown
Owner

@jiahut the build is failing

:serverless:compileJava UP-TO-DATE
:serverless:processResources UP-TO-DATE
:serverless:classes UP-TO-DATE
:serverless:compileTestJavawarning: unknown enum constant Status.STABLE
  reason: class file for org.apiguardian.api.API$Status not found
1 warning
:serverless:processTestResources NO-SOURCE
:serverless:testClasses
:serverless:test
com.iluwatar.serverless.faas.api.LambdaInfoApiHandlerTest > initializationError FAILED
    org.mockito.exceptions.base.MockitoException
        Caused by: java.lang.reflect.InvocationTargetException
            Caused by: org.junit.runners.model.InitializationError
com.iluwatar.serverless.baas.api.SavePersonApiHandlerTest > classMethod FAILED
    java.lang.NoClassDefFoundError
        Caused by: java.lang.ClassNotFoundException
com.iluwatar.serverless.baas.api.FindPersonApiHandlerTest > classMethod FAILED
    java.lang.NoClassDefFoundError
        Caused by: java.lang.ClassNotFoundException
3 tests completed, 3 failed
:serverless:test FAILED
FAILURE: Build failed with an exception.

@jiahut
Copy link
Copy Markdown
Author

jiahut commented Oct 23, 2018

@iluwatar
It work well with performing the following build locally:

gradle build test


> Task :naked-objects:naked-objects-integtests:datanucleusEnhance
Enhancing with DataNucleus the following files
....
/java-design-patterns/naked-objects/integtests/build/classes/java/test/domainapp/dom/modules/simple/SimpleObjectsTest.class
[ant:datanucleusenhancer] Java Result: 1

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 3s
491 actionable tasks: 1 executed, 490 up-to-date

gradle --version

------------------------------------------------------------
Gradle 4.8.1
------------------------------------------------------------

Build time:   2018-06-21 07:53:06 UTC
Revision:     0abdea078047b12df42e7750ccba34d69b516a22

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          1.8.0_151 (Oracle Corporation 25

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented Nov 3, 2018

@jiahut I am able to build the project with ./gradlew clean build but in the build output I see lots of warnings like this

> Task :strategy:compileTestJava
warning: unknown enum constant Status.STABLE
  reason: class file for org.apiguardian.api.API$Status not found
warning: unknown enum constant Status.STABLE
warning: unknown enum constant Status.STABLE
warning: unknown enum constant Status.EXPERIMENTAL
warning: unknown enum constant Status.EXPERIMENTAL
warning: unknown enum constant Status.STABLE
warning: unknown enum constant Status.STABLE
warning: unknown enum constant Status.EXPERIMENTAL
8 warnings

All the Maven build files still seem to be there. Are they still necessary? I'm thinking that with this task we should drop support for Maven and use only Gradle.

Can you provide short instructions for building the project with Gradle? We should use the Gradle wrapper, right?

  • How to build the project with all the submodules
  • How to build + test the project with all the submodules
  • How to build a single submodule
  • How to build and test a single submodule

@iluwatar
Copy link
Copy Markdown
Owner

This pull request is about to be closed due to inactivity

@iluwatar iluwatar added this to the 1.21.0 milestone Jul 21, 2019
@iluwatar iluwatar closed this Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants