I currently have JAVA Maven projects and you are trying to port it to Gradle. I issued the following command to convert it,
gradle init
Do not forget to find the pom.xml, the xml file of the descriptor file of my project and the generated build.gradle files below,
pom.xml
<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"> <modelVersion>4.0.0</modelVersion> <artifactId>ProjectA</artifactId> <packaging>jar</packaging> <name>ProjectA</name> <dependencies> <dependency> <groupId>org.jpos</groupId> <artifactId>jpos</artifactId> <version>113</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/non-distributable-lib/jpos113.jar</systemPath> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.3</version> <configuration> <archive> <manifest> <mainClass>com.test.jpos.Main</mainClass> </manifest> </archive> <descriptor>src/main/assembly/assemble_POSMClient_JPOS_Bridge.xml</descriptor> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build> <parent> <groupId>com.test</groupId> <artifactId>ProjectRoot</artifactId> <version>5.0.0</version> <relativePath>../pom.xml</relativePath> </parent>
build.gradle:
description = 'ProjectA' sourceCompatibility = 1.8 targetCompatibility = 1.8 dependencies { compile files('src/main/non-distributable-lib/jpos113.jar') }
assemble_POSMClient_JPOS_Bridge.xml:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>assemble_pos</id> <formats> <format>jar</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <outputDirectory>/</outputDirectory> <useProjectArtifact>true</useProjectArtifact> <unpack>true</unpack> <scope>runtime</scope> </dependencySet> </dependencySets> <fileSets> <fileSet> <directory>${project.basedir}/../POSMClient-Common/src/main/lib/Packaged-Web-Components</directory> <outputDirectory>Packaged-Web-Components</outputDirectory> <includes> <include>**/*.*</include> </includes> <excludes> <exclude>www.zip</exclude> <exclude>*.uncompressed.js</exclude> <exclude>js/lib/cometd/*</exclude> <exclude>.gitmodules</exclude> <exclude>README.md</exclude> <exclude>package.sh</exclude> <exclude>updateDojo.sh</exclude> </excludes> </fileSet> <fileSet> <directory>${project.basedir}/../POSMClient-Common/src/main/native</directory> <outputDirectory>Packaged-Web-Components/</outputDirectory> <includes> <include>*</include> </includes> </fileSet> </fileSets>
Note: When I do a clean, no exceptions occur and succeed, but the jar collector file cannot be created.
gradle clean
Failed to create build plugin section in build.gradle file. Please let me know if something is missing.
source share