Copy spring boot packaged fatjar to another directory
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Dokumentation
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- spring-boot
- Bereich
- documentation
Rechercherichtung
Review the repository's existing programming-tip structure before deciding where this material belongs. Use the Maven install-phase guidance and the three listed copying options as the source, and consider the work done when the fat JAR copying instructions are added in the repository's established format with the relevant command and phase details.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
There are at last 3 options to fulfill this case.
Option 1.By maven-resource-plugin:
https://stackoverflow.com/questions/6689511/how-to-place-the-output-jar-into-another-folder-with-maven#comment7915129_6689511
https://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-files-on-build</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/[TO-DIR]</outputDirectory>
<resources>
<resource>
<directory>[FROM-DIR]</directory>
<!--<include>*.[MIME-TYPE]</include>-->
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
Option 2: By maven assembly plugin
https://maven.apache.org/plugins/maven-assembly-plugin/usage.html
<!-- when running mvn install , copy my-web.jar to APP-META/docker/config folder automatically(for docker build) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>copy-installed</id>
<phase>install</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
<destFileName>my-web.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>../APP-META/docker-config/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Option 3: By ant run plugin
https://stackoverflow.com/questions/6689511/how-to-place-the-output-jar-into-another-folder-with-maven#comment7915129_6689511
Notes: You should execute the goal at the install phase, not the package phase. The origin jar file in install phase does not contain necessary dependencies in the file content. while the jar file in the install phase contains the necessary dependencies in it which is repackaged by spring boot plugin.
install
maven command
run mvn package install instead of mvn package, to copy the final jar to expected output directory.
- Vorherrschende Sprache
- Python
- Sterne
- 5
- Forks
- 2
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus davideuler/programming-tips
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 35/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 45/100
-
build milvus on MacOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
Alle Issues in davideuler/programming-tips
Ähnliche Issues
-
area:scripts area:tests bug priority:later
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Ikalus1988/MisakaNet#4358 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Discovered ports from service discovery are never propagated to modules in Module.load()Evtl. vergeben @vishalmore90 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
OWASP/Nettacker#1828 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
aws-samples/sample-per-model-bedrock#708 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
[Performance] Bound resolve_api_hashes raw fallback reads to the 1 MiB region actually scannedOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
sjkim1127/Reversecore_MCP#365 ·
Maintainer antworten meist innerhalb von 1 Tag