how disable liquibase in jhipster 7.7.0 - spring-boot

I'd like to know how can I temporarily disable Liquibase in JHipster 7.7.0 there is a similar question here I tried this suggested solution but it shows this error
org.springframework.boot.context.config.InvalidConfigDataPropertyException:
Property 'spring.profiles.include' imported from location 'class path
resource [config/application-dev.yml]' is invalid in a profile
specific resource [origin: class path resource
[config/application-dev.yml] - 43:14]
EDIT
I want to disable it because everytime I run mvnw I got this message and it takes minutes before the app get started on my localhost
2022-05-12 22:49:44.878 DEBUG 13536 --- [ restartedMain]
m.p.g.config.LiquibaseConfiguration : Configuring Liquibase
2022-05-12 22:49:45.380 WARN 13536 --- [on-rd-vs-task-1]
t.j.c.liquibase.AsyncSpringLiquibase : Starting Liquibase
asynchronously, your database might not be ready at startup!
Thank you in advance

Maven project
In order to disable Liquibase in Maven-based project, you need to edit pom.xml file and add the new profile in the profiles node.
...
<profile>
<id>no-liquibase</id>
<properties>
<profile.no-liquibase>,no-liquibase</profile.no-liquibase>
</properties>
</profile>
...
pom.xml
If you’re using IntelliJ IDEA you can do it conveniently using Maven menu and Profiles group as well.
source: https://blog.mestwin.net/how-to-disable-liquibase-in-your-jhipster-project
Another option is to run your application like that ./mvnw -Pdev,no-liquibase
source: https://www.jhipster.tech/profiles/#spring-profiles-switches

Related

Spring web application with profile

I have a spring application with multiple profile like dev,prod. application running on external tomcat.profile are setting in the pom.xml file
pom.xml
<profiles>
<profile>
<id>dev</id>
<properties>
<repoManager>Manager1</repoManager>
..........
</properties>
</profile>
</profiles>
Project have applicationContext.xml file.
One of the bean definition, we are taking repoManager the value from dev profile.
when i run the application, throwing the following error
rg.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name '<Class name>' defined in class path resource [applicationContext.xml]: Circular placeholder reference 'repoManager' in property definitions
How to run spring web application with profile dev
I have done following changes
Added spring.profiles.active=dev in catalina.properties file
Added setenv.sh in tomcat bin folder
Added spring.profiles.active=dev on STS run configuration
Above 3 solution are not working.
How to solve this problem.
Thanks in advance.
I Got the answer
Right click on the project -> Maven -> Select Maven Profiles... and pickup your profile.
No Need to do above steps.

ConversionException in running a Jmeter jmx file with Ultimate thread group in Intellij maven

Facing the below issue in running Ultimate thread group jmx in intellij maven (please note, for normal thread group jmx file, there is no issue. And in pom file also the required dependencies are added, which i believe is the ctg(custom thread group) one) . I am getting this error for that jmx execution alone -
missing class Conversion Exception:
required-type-ListedHashTree
converter-type-ScriptWrapperConverter
What needs to be changed now to make it executable in intellij . I am using mvn commands to trigger the jmx
I think you need to add the following dependency to your project classpath:
jmeter-plugins-casutg
Something like:
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-casutg</artifactId>
<version>2.10</version>
</dependency>
You may find Five Ways To Launch a JMeter Test without Using the JMeter GUI article and jmeter-from-code repository for some examples.
I had found the solution to this. Apart from adding it to the dependency,
You need to add this also to the jmeter extensions in the pom.xml
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-casutg:2.8</artifact>
</jmeterExtensions>
My script started running after this change in pom.xml

Liquibase scripts not getting executed when app is packaged

I’m facing a strange issue with Liquibase (I am using 3.4.2) :
When I start the application from my IDE, new scripts get deployed with no issue.
When I package my application (as a jar) and deploy it in my CI pipeline, scripts don’t get executed and I get below error :
INFO 8 --- [ main] liquibase : Successfully acquired change log lock
WARN 8 --- [ main] liquibase : included file classpath:/db/changelog/db.changelog-master.yaml/ is not a recognized file type
I’m using includeAll mode:
databaseChangeLog:
- includeAll:
path: changes
relativeToChangelogFile: true
Also, in case it makes a difference, I have several modules in my application (a Spring Boot app) :
My main application is moduleA : this is the jar I build and run
moduleA has a dependency on moduleB, in which the Liquibase scripts are
problem seems to be similar to the one described here : http://forum.liquibase.org/topic/includeall-not-working-for-multimodule-project-with-spring , but no solution is provided.
After trying various things, like including files one by one, or upgrade Liquibase version, it looks like the simplest way to get this to work is to tweak spring-boot-maven-plugin config for moduleA by unpacking files : this way, Liquibase is able to find the files it’s looking for.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<requiresUnpack>
<dependency>
<groupId>com.mydomain</groupId>
<artifactId>moduleB</artifactId>
</dependency>
</requiresUnpack>
</configuration>
</plugin>

Mule Munit test with maven : mule-domain-config.xml file not found?

Mule Munit test with maven : mule-domain-config.xml file not found
I am getting an error while trying to run Munit using Maven. It's a domain project and my Munit test cases are available in mule projects. when I ran maven, it is giving me file not found exception (mule-domain-config.xml). I tried all possible ways by checking in this site but of no luck. Below is the stack trace.
INFO 2017-01-06 01:15:01,226 [main] org.mule.munit.runner.MuleContextManager: Loading mule-app.properties ... INFO 2017-01-06 01:15:01,319 [main] org.mule.munit.runner.domain.MunitDomainContextBuilder: Loading mule-deploy.properties ... java.lang.RuntimeException: org.mule.api.config.ConfigurationException: mule-domain-config.xml (java.io.FileNotFoundException)
i already checked my pom configuration and i used an AnypointStudio.exe clean also.
Please add domain project dependency with test scope to your pom file like
<dependency>
<groupId>domain project group id</groupId>
<artifactId>domain project name</artifactId>
<version>domain version</version>
<scope>test</scope>
</dependency>
Hope this helps.
Can you check if you are loading your mule domain config xml in your munit settings.
For instance...
<munit:config name="munit" doc:name="MUnit configuration"/>
<spring:beans>
<spring:import resource="classpath:my-munit-test.xml"/>
<spring:import resource="mule-domain-config.xml"/>
</spring:beans>
<munit:test name="tesad-test-suite-FlowTest"...
Check the spring:import lines
Also, as #anupambhusari said , please check that you are importing your domain config properly
I am not sure if you found a solution of this problem, but I got this working by adding Mule domain project in build path, from Configure Build Path option.

Spring Boot - Could not resolve placeholder when ran from jar file

I'm running into this strange issue where I can run my Spring Boot application without problems from within Intellij, but when I do:
mvn clean package -Pst -Dspring.profiles.active=st && java -jar target/myapp-0.0.1-SNAPSHOT.jar
I can see errors saying Spring Boot cannot resolve the #Value placeholders.
ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.IllegalArgumentException: Could not resolve placeholder
What I did to investigate was to get the jar file and extract the files like using jar xf myapp.jar and I can see the properties files in the classpath root. Initially I had this problem that Maven was not packaging my properties and statics from the main/resource folder, but I already resolved that with:
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>static</directory>
<targetPath>static</targetPath>
</resource>
Any comments, ideas what could I be missing here?
I managed to resolve this. It was really weird, it seems that I need to tell java in which profile to run the jar in e.g --spring.profiles.active=st.
mvn clean package -Pst -Dspring.profiles.active=st && java -jar target/myapp-0.0.1-SNAPSHOT.jar --spring.profiles.active=st
It is not Maven deciding, what Spring Profile you use, but the Spring container during every single execution of the jar. The differen profiles are all available. The Spring profile is used to adapt the executable to different environments by configuration.
There are additionally Maven profiles, but they configure the build of the executable, not the execution.

Resources