Tag: spring boot maven plugin

使用spring boot maven插件重新打包后,JAR文件中缺less资源

我的应用程序使用一些额外的文件,我有资源文件夹内。 当我使用Maven进行常规构build并将我的应用程序打包到JAR中时,我可以看到我的所有资源,以便解压缩该文件。 但是当我创build一个docker镜像时,我使用了spring-boot-maven-plugin来使我的JAR文件可执行。 出于某种原因, 我的资源没有被添加到新的重新包装的JAR中 。 此外,我甚至无法解压,因为它已经损坏。 这是我在我的pom.xml中设置重新打包目标的方式: <id>prod</id> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>1.5.3.RELEASE</version> <configuration> <mainClass>ApplicationName</mainClass> <executable>true</executable> <arguments> <argument>–spring.profiles.active=prod</argument> </arguments> <!–<addResources>true</addResources>–> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> <configuration> <!–<includeSystemScope>true</includeSystemScope>–> <!–<layout>JAR</layout>–> </configuration> </execution> </executions> </plugin> </plugins> </build> 我想补充说,当我在泊坞窗中运行我的图像它工作正常, 但所有需要的资源都缺less 。 有没有人遇到同样的问题? 或者,也许你可以build议如何解决它。

如何解决使用Maven将Docker Image推送到私有存储库时的身份validation问题

我试图推动我的Docker镜像,这是我在本地使用maven构build到我的公共/私人存储库在Docker云/ Docker Hub.But我得到索引响应不包含任何端点时,它试图Push.Below是样本我的pom.xml的configuration。 我不知道我错过了哪个configuration。 <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.4.11</version> <configuration> <imageName>${docker.image.prefix}/dockercloudappstation</imageName> <dockerDirectory>src/main/docker</dockerDirectory> <!– <dockerHost>tcp://192.168.99.100:2376</dockerHost> –> <serverId>docker-hub</serverId> <!– <registryUrl>https://hub.docker.com/</registryUrl> –> <resources> <resource> <!– <targetPath>/</targetPath> –> <directory>${project.build.directory}</directory> <include>${project.build.finalName}.jar</include> </resource> </resources> </configuration> <executions> <execution> <id>build-image</id> <phase>package</phase> <goals> <goal>build</goal> </goals> </execution> <execution> <id>tag-image-version</id> <phase>package</phase> <goals> <goal>tag</goal> </goals> <configuration> <!– <image>${docker.image.prefix}/${project.artifactId}</image> –> <image>${docker.image.prefix}/dockercloudappstation</image> <newName>hub.docker.com/${docker.image.prefix}/dockercloudappstation</newName> <!– […]