gradle init fails to migrate exiting maven projects

Created on 6 Mar 2018  路  3Comments  路  Source: gradle/gradle

We have exiting maven projects and we tried to migrate them using gradle init. It migrated projects but when i try to import in the tools and those projects fail to import due to the error generated from gradle init.

One of the child EJB project has dependency on JPA project and here is the entry in pom.xml

com.ibm.ws.svt.gs.garagesale-ee7
CreditCardDBJPA
0.0.1-SNAPSHOT
provided

After gradle init the following entry is generated in build.gradle file and this is failed to import in tools.

description = ''
dependencies {
compileOnly group: 'javax.ejb', name: 'javax.ejb-api', version:'3.2'
compileOnly group: 'org.eclipse.persistence', name: 'javax.persistence', version:'2.1.1'
providedCompile project(':CreditCardDBJPA')
}

In the above build file, the gradle init should have generated with "compileOnly" rather "providedCompile"

Expected Behavior

In the above build file, the gradle init should have generated with "compileOnly" rather "providedCompile"

Current Behavior

In the above build file, the gradle init generated with "providedCompile" .

Error
Could not find method providedCompile() for arguments [project ':CreditCardDBJPA'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Context

We got into this problem when migrating existing maven projects into Gradle projects.

Steps to Reproduce (for bugs)

Here are the projects generated from gradle init.
TestProjects.zip

### Your Environment

Gradle 4.5.1

Build time: 2018-02-05 13:22:49 UTC
Revision: 37007e1c012001ff09973e0bd095139239ecd3b3

Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_151 (IBM Corporation 2.9)
OS: Windows 10 10.0 amd64

bug contributor build-init-plugin stale

Most helpful comment

Bump! This is an important issue...

All 3 comments

Bump! This is an important issue...

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cjdxhjj picture cjdxhjj  路  43Comments

bsideup picture bsideup  路  115Comments

carlspring picture carlspring  路  46Comments

kevinrushforth picture kevinrushforth  路  115Comments

gocursor picture gocursor  路  38Comments