Pom.xml to gradle.script conversion


(Raphael C. Okere) #1

When i run “gradle init” in the directory of my master pom.xml file, i get gradle scripts created for all but one pom.xml in my multiproject build. Also in the main component of my multi-build my build.gradle script looks like this:

description = ‘DBSupport main component of DBSupportTool’ dependencies {

providedCompile project(’:Core:Platform’)

providedCompile project(’:Core:Verification’)

providedCompile project(’:DBSupportWeb’)

providedCompile project(’:DBSupportEJB’)

compile(group: ‘commons-lang’, name: ‘commons-lang’, version:‘1.0.1’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘commons-logging’, name: ‘commons-logging’, version:‘1.0.4’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘javax’, name: ‘j2ee’, version:‘1.0’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘org.nfunk’, name: ‘jep’, version:‘2.4.0’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘log4j’, name: ‘log4j’, version:‘1.2.8’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘poi’, name: ‘poi’, version:‘2.5.1-final-20040804’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘com.sybase’, name: ‘jconn3’, version:‘6.0’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘xerces’, name: ‘xerces’, version:‘1.4.4’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘xmlwriter’, name: ‘xmlwriter’, version:‘2.2’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘com.jcraft’, name: ‘jsch’, version:‘0.1.39’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘javax.mail’, name: ‘mail’, version:‘1.4.1’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘javax.activation’, name: ‘activation’, version:‘1.1.1’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

}

compile(group: ‘org.springframework’, name: ‘spring’, version:‘1.2.7’) {

/* This dependency was originally in the Maven provided scope, but the project was not of type war.

This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.

Please review and delete this closure when resolved. */

} }

Her is the pom.xml that did not get converted, how would the build.gradle script be written:

(<project xmlns=“http://maven.apache.org/POM/4.0.0

xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0

http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

DBST

pom

com.gpc.tamsii

DBSupportTool

1.00.00.00-SNAPSHOT

DBST main component of DBSupportTool

maven-resources-plugin

2.4.1

copy-resources

process-resources

copy-resources

${project.build.directory}/${project.artifactId}-${project.version}-${environment}

src/main/resources

true

org.apache.maven.plugins

maven-dependency-plugin

copy

package

copy

${project.groupId}

DBSupport

${project.version}

ear

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/jboss/server/dbsupport/deploy/

DBSupport.ear

${project.groupId}

Verification

${project.version}

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/jars/

Verification.jar

javax.activation

activation

1.1.1

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/lib/

commons-logging

commons-logging

1.0.4

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/lib/

com.jcraft

jsch

0.1.39

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/lib/

log4j

log4j

1.2.8

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/lib/

javax.mail

mail

1.4.1

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/lib/

xerces

xerces

1.4.4

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/lib/

xmlwriter

xmlwriter

2.2

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv/lib/

unpack

package

unpack

${project.groupId}

Verification

${project.version}

/properties/*,/xsd/sv/*

${project.build.directory}/${project.artifactId}-${project.version}-${environment}/usr/tams/sv

true

true

org.apache.maven.plugins

maven-assembly-plugin

${environment}

single

package

src/main/assembly/resources.xml

org.codehaus.mojo

build-helper-maven-plugin

attach-artifacts

package

attach-artifact

${project.build.directory}/${project.artifactId}-${project.version}-${environment}.tar.gz

tar.gz

${environment}

${project.groupId}

DBSupport

${project.version}

ear

${project.groupId}

Verification

${project.version}

javax.activation

activation

1.1.1

commons-logging

commons-logging

1.0.4

com.jcraft

jsch

0.1.39

log4j

log4j

1.2.8

javax.mail

mail

1.4.1

xerces

xerces

1.4.4

xmlwriter

xmlwriter

2.2

dev

true

org.apache.maven.plugins

maven-antrun-plugin

deploy-all

deploy

${deploy.server.prompt}

su -

Password:

${deploy.server.root.pass}

${deploy.server.prompt}

cd ${deploy.server.ftp.dir}

${deploy.server.prompt}

gunzip ${deploy.file}.tar.gz

${deploy.server.prompt}

mv ./${deploy.file}.tar /

${deploy.server.prompt}

cd /

${deploy.server.prompt}

tar -xvf ${deploy.file}.tar

${deploy.server.prompt}

chown -R appserv:other /usr/jboss/server/dbsupport

${deploy.server.prompt}

chown appserv:other /usr/jboss/bin/run.conf

${deploy.server.prompt}

chown -R appserv:other /usr/tams/sv

${deploy.server.prompt}

/etc/init.d/appserv stop

${deploy.server.prompt}

/etc/init.d/appserv start

${deploy.server.prompt}

run

org.apache.ant

ant-commons-net

1.7.0

org.apache.ant

ant

1.7.0

sshtools

j2ssh-ant

0.2.2

sshtools

j2ssh-core

0.2.2

commons-logging

commons-logging

1.0.4

qa

org.apache.maven.plugins

maven-antrun-plugin

deploy-archive

deploy

run

org.apache.ant

ant-commons-net

1.7.0

org.apache.ant

ant

1.7.0

org.codehaus.mojo

sql-maven-plugin

1.4

mysql

mysql-connector-java

5.1.10

com.mysql.jdbc.Driver

jdbc:mysql://10.10.12.112:3306/bugs

ACTDB

${maven.test.skip}

add-act-version

install

execute

true

INSERT INTO versions (‘value’, ‘product_id’) VALUES (‘v.${project.version}’, 74)

continue

prod

org.apache.maven.plugins

maven-antrun-plugin

deploy-archive

deploy

run

org.apache.ant

ant-commons-net

1.7.0

org.apache.ant

ant

1.7.0

org.codehaus.mojo

sql-maven-plugin

1.4

mysql

mysql-connector-java

5.1.10

com.mysql.jdbc.Driver

jdbc:mysql://10.10.12.112:3306/bugs

ACTDB

${maven.test.skip}

add-act-version

install

execute

true

INSERT INTO versions (‘value’, ‘product_id’) VALUES (‘v.${project.version}’, 74)

continue

)


(Benjamin Muschko) #2

Would you formatting your code pieces properly with the <code> tag? At the moment it’s hard to grab the problem. Also is there an error message for the project that cannot be converted?


(Raphael C. Okere) #3

Here is the error i get when converting the pom in the DBST directory

Could not find method providedCompile() for arguments [project ':Core:Platform ] on project ‘:DBSupport’.


(himalay majumdar) #4

I am getting the same issue, ‘gradle init’ generated “providedCompile group: ‘javax.servlet’, name: ‘servlet-api’, version:‘2.5’” and when I do ‘gradle clean’ it complains saying

“Caused by: org.gradle.api.internal.MissingMethodException: Could not find method providedCompile() for arguments [{group=javax.servlet.jsp, name=jsp-api, version=2.1}] on root project ‘bham’.”