How to create executable java jar using maven and gradle

Publicado em: 21 Outubro 2021
no canal de: Ashik's Tech Vlog
2,246
13

Executable jar using the command line:    • How to a create executable java jar file u...  

Maven:-
------------
add the following section in the pom.xml
N.B.: replace all () by xml tags
(dependencies)
(dependency)
(groupId)org.apache.maven.plugins(/groupId)
(artifactId)maven-assembly-plugin(/artifactId)
(version)2.3(/version)
(type)maven-plugin(/type)
(/dependency)
(/dependencies)
(build)
(plugins)
(plugin)
(artifactId)maven-assembly-plugin(/artifactId)
(configuration)
(archive)
(manifest)
(mainClass)demo.test.executable.Main(/mainClass)
(/manifest)
(/archive)
(descriptorRefs)
(descriptorRef)jar-with-dependencies(/descriptorRef)
(/descriptorRefs)
(/configuration)
(executions)
(execution)
(id)make-assembly(/id)
(phase)package(/phase) (!-- packaging phase --)
(goals)
(goal)single(/goal)
(/goals)
(/execution)
(/executions)
(/plugin)
(/plugins)
(/build)

Gradle:-
----------
add the following section in the build.gradle file

jar {
manifest {
attributes 'Main-Class': 'demo.test.executable.Main'
}
}


Nesta página do site você pode assistir ao vídeo on-line How to create executable java jar using maven and gradle duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ashik's Tech Vlog 21 Outubro 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 2,246 vezes e gostou 13 espectadores. Boa visualização!