0% found this document useful (0 votes)
5 views4 pages

Program 4 Code

The document outlines the steps to create a Maven project and migrate it to Gradle. It includes configurations for Maven plugins such as the compiler and jar plugins, specifying Java version and main class. Additionally, it provides a Gradle build script with the necessary plugins, group, version, repositories, and dependencies for the project.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Program 4 Code

The document outlines the steps to create a Maven project and migrate it to Gradle. It includes configurations for Maven plugins such as the compiler and jar plugins, specifying Java version and main class. Additionally, it provides a Gradle build script with the necessary plugins, group, version, repositories, and dependencies for the project.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Program 4

Create maven project and Migrate to gradle

<build>
<plugins>
<!-- Compiler Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Jar Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<mainClass>com.example.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Copy the below cope in build.gradle
plugins {
id 'java'
}

group = 'com.example'
version = '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
testImplementation 'junit:junit:4.13.2'
}

jar {
manifest {
attributes(
'Main-Class': 'com.example.App'
)
}
}

You might also like