Build Tools
Maven
Dependency file
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-maven</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>hello.HelloWorld</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project><modelVersion>. POM model version (always 4.0.0).<groupId>. Group or organization that the project belongs to. Often expressed as an inverted domain name.<artifactId>. Name to be given to the project’s library artifact (for example, the name of its JAR or WAR file).<version>. Version of the project that is being built.<packaging>- How the project should be packaged. Defaults to "jar" for JAR file packaging. Use "war" for WAR file packaging.
Command
compiled .class files which is bytecode file in the target/classes directory.
packaging the code up in a JAR file within the target directory. The name of the JAR file will be based on the project’s
<artifactId>and<version>. For example, given the minimal pom.xml file from before, the JAR file will be named gs-maven-0.1.0.jar.After that the artifact can be executed by
Gradle
Dependency file
Command
To see the results of the build effort, take a look in the build folder. Therein you’ll find several directories, including these three notable folders:
classes. The project’s compiled .class files.
reports. Reports produced by the build (such as test reports).
libs. Assembled project libraries (usually JAR and/or WAR files).
Last updated
Was this helpful?