Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Useful link https://www.baeldung.com/executable-jar-with-maven#bd-thymeleaf-4

The command to create a new maven project 

...

Code Block
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
						<configuration>
							<classifier>spring-boot</classifier>
							<mainClass>
								com.celestial.vatcsl.VatCalculatorServiceApplication
							</mainClass>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>


Latest Maven plugin that builds an executable with MainClass path

Code Block
  <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <executions>
            <execution>
              <goals>
                <goal>shade</goal>
              </goals>
              <configuration>
                <finalName>kafka_demo</finalName>
                <shadedArtifactAttached>true</shadedArtifactAttached>
                <transformers>
                  <transformer implementation=
                                       "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                    <mainClass>org.celestial.kafka.producer.App</mainClass>
                  </transformer>
                </transformers>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
  </build>