spring-boot-maven-plugin

Springboot and maven: how to launch unit tests automatically with two profiles

匆匆过客 提交于 2019-12-25 01:09:41
问题 This question is the continuation of question "SpringBoot: how to run tests twice, with two different config files". I use to compile my project using mvn clean install . Doing that, maven also launches my unit tests and I immediately knows whether my development is correct. I am actually working on a module that embeds a JMS connection. my module supports two JMS buses: EMS and AMQ. The bus to be used is specified in the configuration of my module As a consequence, I need to create two

Spring Boot webserver works fine in Eclipse, fails to start on Server : missing EmbeddedServletContainerFactory bean

喜夏-厌秋 提交于 2019-12-21 20:00:24
问题 Following the model of the Spring Documentation I created a very simple Hello World like application. It spun right up on Eclipse and everything looked great. Sweet! I ran it and could browse to the URL. Fastest development ever. But this has to run on a server, and looking at the jar, it was only about 4K so I knew that it wasn't going to work without a bunch of classpath configuration. To avoid that, I figured I needed a jar-with-dependencies jar. So this is my pom.xml, basically identical

Import spring boot app into another project

情到浓时终转凉″ 提交于 2019-12-21 04:32:20
问题 So I am attempting to add a spring boot executable jar as a dependency in another project (Testing framework). However once added to the pom and imported. Java imports don't work properly. If I look inside the jar all packages are prepended with: BOOT-INF/classes.some.package.classname.class There is also some spring boot related packages, MANIFEST etc etc. Not if I switch the spring boot app's build to just install and deploy a regular jar using the spring-boot-maven-plugin This changes and

How to use inlinedConfScript to configure JAVA_OPTS with maven?

ε祈祈猫儿з 提交于 2019-12-13 03:39:20
问题 I have tried to configure it like this but there will be an exception! <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <skip></skip> <executable>true</executable> <embeddedLaunchScriptProperties> <property> <name>inlinedConfScript</name> <value>/app/knowledge-base.conf</value> </property> </embeddedLaunchScriptProperties> </configuration> </plugin> </plugins> </build> Failed to execute goal org

Springboot not loading application.dev.properties file

那年仲夏 提交于 2019-12-12 08:26:20
问题 In my project I want to use environment specific property file. For example if I am running it into development it should use application.dev.properties, for production it should use application.prod.properties and so on. I have below two files in my resources folder. application.properties (For production) application.dev.properties (For development) I have one properties like below in each file. For Prod server.database.host=192.168.1.1 For Dev server.database.host=192.168.12.125 And I have

How to Auto Scale Microservices in Local server without cloud using JAVA

笑着哭i 提交于 2019-12-11 17:42:14
问题 Hi I am new to the microservices. I have created spring boot(maven) microservices (2 services, 1 gateway and service registry). How can I scale (auto scaling) 2 services without cloud technology. Is it possible in the local configuration? 回答1: I use Docker swarm and this gives me a cloud-like environment where I can upscale or downscale a service very easily. You can read here about using Docker with Spring Boot. There is also this article. P.S. Docker and Docker swarm are free or charge (the

Alternatives to distribute spring-boot application using maven (other than spring-boot:repackage)

对着背影说爱祢 提交于 2019-12-11 11:47:21
问题 As far as I know, spring-boot-maven-plugin has already provided a way to distribute the entire application in a fat executable jar file: spring-boot-maven-plugin However, sometimes we don't want a fat executable jar that encapsulates all the modules and dependencies and configuration files and such, maybe a zip/tar file with the main module in a jar and launch scripts for different platforms alongside the jar, and dependencies under the lib folder and configurations file reside in the conf

SpringBoot no main manifest attribute (maven)

前提是你 提交于 2019-12-10 13:06:27
问题 When running my jar file : java -jar target/places-1.0-SNAPSHOT.jar I'm getting the next error : no main manifest attribute, in target/places-1.0-SNAPSHOT.jar My pom.xml contains the spring-boot-maven-plugin : <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>com.places.Main</mainClass> </configuration> </plugin> I also tried to create a MANIFEST.MF FILE and specifying the class but it didnt help. In addition, I

SpringBoot Application Startup Failed due to autowire JavaMailSender - version 2.0.0-snapshot

女生的网名这么多〃 提交于 2019-12-10 10:24:39
问题 I m using Spring Boot 2.0.0.BUILD-SNAPSHOT . I have a problem when autowiring JavaMailSender or JavaMailSenderImpl . If i configure @Autowired for JavaMailSender , i m getting below error. *************************** APPLICATION FAILED TO START *************************** Description: Field mailSender in com.hm.assetmanagment.service.MailService required a bean of type 'org.springframework.mail.javamail.JavaMailSenderImpl' that could not be found. - Bean method 'mailSender' not loaded because

Can spring-boot-maven-plugin be used for non spring project?

天大地大妈咪最大 提交于 2019-12-10 10:18:07
问题 The spring-boot-maven-plugin main goal is to package spring boot application into executable jar with all dependencies. Can it be used in projects without spring or spring boot? I meen not using spring dependencies, but just classloader mechanism for loading depended jars. 回答1: Yes you can! Actually I tested and I was happy to find the spring-boot-maven-plugin repackage is completely agnostic of what the Main class uses and is for the most part completely decoupled from the Springframework