Liquibase : link main yaml changelog from test
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to link yaml database creation rules from src/main/resources.. in src/test/resources and add one more chagngelog with sample data.
srctestresourcesdbchangelogdb.changelog-master.yaml :
databaseChangeLog:
- include:
file: ../../main/resources/db/changelog/db.changelog-master.yaml
- include:
file: db/changelog/marketplace/sampleData.yaml
But it doesn't work. So, the error is : Error parsing ../../main/resources/db/changelog/db.changelog-master.yaml
Is there any other options to link main resources from main?
This is a spring boot project.
Error stack trace :
Caused by: liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:84)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:190)
at liquibase.Liquibase.update(Liquibase.java:179)
at
...
Caused by: java.io.FileNotFoundException: class path resource [../../main/resources/db/changelog/db.changelog-master.yaml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195)
at liquibase.integration.spring.SpringLiquibase$SpringResourceOpener.getResourcesAsStream(SpringLiquibase.java:504)
at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:186)
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:27)
... 52 more
java database spring spring-boot liquibase
add a comment |
I want to link yaml database creation rules from src/main/resources.. in src/test/resources and add one more chagngelog with sample data.
srctestresourcesdbchangelogdb.changelog-master.yaml :
databaseChangeLog:
- include:
file: ../../main/resources/db/changelog/db.changelog-master.yaml
- include:
file: db/changelog/marketplace/sampleData.yaml
But it doesn't work. So, the error is : Error parsing ../../main/resources/db/changelog/db.changelog-master.yaml
Is there any other options to link main resources from main?
This is a spring boot project.
Error stack trace :
Caused by: liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:84)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:190)
at liquibase.Liquibase.update(Liquibase.java:179)
at
...
Caused by: java.io.FileNotFoundException: class path resource [../../main/resources/db/changelog/db.changelog-master.yaml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195)
at liquibase.integration.spring.SpringLiquibase$SpringResourceOpener.getResourcesAsStream(SpringLiquibase.java:504)
at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:186)
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:27)
... 52 more
java database spring spring-boot liquibase
1
Error parsing...
. I bet there will be narrowed message about what exactly cannot be parsed.
– luboskrnac
Nov 16 '18 at 12:26
@luboskrnac added error trace
– Anton Barinov
Nov 16 '18 at 12:34
add a comment |
I want to link yaml database creation rules from src/main/resources.. in src/test/resources and add one more chagngelog with sample data.
srctestresourcesdbchangelogdb.changelog-master.yaml :
databaseChangeLog:
- include:
file: ../../main/resources/db/changelog/db.changelog-master.yaml
- include:
file: db/changelog/marketplace/sampleData.yaml
But it doesn't work. So, the error is : Error parsing ../../main/resources/db/changelog/db.changelog-master.yaml
Is there any other options to link main resources from main?
This is a spring boot project.
Error stack trace :
Caused by: liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:84)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:190)
at liquibase.Liquibase.update(Liquibase.java:179)
at
...
Caused by: java.io.FileNotFoundException: class path resource [../../main/resources/db/changelog/db.changelog-master.yaml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195)
at liquibase.integration.spring.SpringLiquibase$SpringResourceOpener.getResourcesAsStream(SpringLiquibase.java:504)
at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:186)
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:27)
... 52 more
java database spring spring-boot liquibase
I want to link yaml database creation rules from src/main/resources.. in src/test/resources and add one more chagngelog with sample data.
srctestresourcesdbchangelogdb.changelog-master.yaml :
databaseChangeLog:
- include:
file: ../../main/resources/db/changelog/db.changelog-master.yaml
- include:
file: db/changelog/marketplace/sampleData.yaml
But it doesn't work. So, the error is : Error parsing ../../main/resources/db/changelog/db.changelog-master.yaml
Is there any other options to link main resources from main?
This is a spring boot project.
Error stack trace :
Caused by: liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:84)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:190)
at liquibase.Liquibase.update(Liquibase.java:179)
at
...
Caused by: java.io.FileNotFoundException: class path resource [../../main/resources/db/changelog/db.changelog-master.yaml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195)
at liquibase.integration.spring.SpringLiquibase$SpringResourceOpener.getResourcesAsStream(SpringLiquibase.java:504)
at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:186)
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:27)
... 52 more
java database spring spring-boot liquibase
java database spring spring-boot liquibase
edited Nov 16 '18 at 12:59
luboskrnac
16.1k54874
16.1k54874
asked Nov 16 '18 at 12:02
Anton BarinovAnton Barinov
687
687
1
Error parsing...
. I bet there will be narrowed message about what exactly cannot be parsed.
– luboskrnac
Nov 16 '18 at 12:26
@luboskrnac added error trace
– Anton Barinov
Nov 16 '18 at 12:34
add a comment |
1
Error parsing...
. I bet there will be narrowed message about what exactly cannot be parsed.
– luboskrnac
Nov 16 '18 at 12:26
@luboskrnac added error trace
– Anton Barinov
Nov 16 '18 at 12:34
1
1
Error parsing...
. I bet there will be narrowed message about what exactly cannot be parsed.– luboskrnac
Nov 16 '18 at 12:26
Error parsing...
. I bet there will be narrowed message about what exactly cannot be parsed.– luboskrnac
Nov 16 '18 at 12:26
@luboskrnac added error trace
– Anton Barinov
Nov 16 '18 at 12:34
@luboskrnac added error trace
– Anton Barinov
Nov 16 '18 at 12:34
add a comment |
3 Answers
3
active
oldest
votes
I would suggest to name changelog file located in test path differently, because during test, main
/test
paths are merged into one relative path for the test suite run. I suspect Liquibase thinks that you are trying to include same file recursively.
Just rename your db.changelog-master.yaml
under test path to db.changelog-master-test.yaml
ok, it's working now, but the problem that it starts with files from test, and then i get an exception, cause there are no tables, which will create in main
– Anton Barinov
Nov 16 '18 at 12:52
add a comment |
We include SQL files this way:
- sqlFile:
encoding: utf8
path: /db/changelog/schema/schema.sql
So try to add slash at the beginning.
no, it doesn' help
– Anton Barinov
Nov 16 '18 at 12:36
add a comment |
Give the full path instead of ../../main/resources/db/changelog/db.changelog-master.yaml
compiler is not able to parse the path in .. format.
Below is enough to load file if the file is present in classpath otherwise give full project context path.
db/changelog/db.changelog-master.yaml
I couldn't just hard code the full path of my system, it makes no sence. And it's not in the classpath
– Anton Barinov
Nov 16 '18 at 12:23
here full path is not system path it is project context path.
– Alien
Nov 16 '18 at 12:24
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337527%2fliquibase-link-main-yaml-changelog-from-test%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I would suggest to name changelog file located in test path differently, because during test, main
/test
paths are merged into one relative path for the test suite run. I suspect Liquibase thinks that you are trying to include same file recursively.
Just rename your db.changelog-master.yaml
under test path to db.changelog-master-test.yaml
ok, it's working now, but the problem that it starts with files from test, and then i get an exception, cause there are no tables, which will create in main
– Anton Barinov
Nov 16 '18 at 12:52
add a comment |
I would suggest to name changelog file located in test path differently, because during test, main
/test
paths are merged into one relative path for the test suite run. I suspect Liquibase thinks that you are trying to include same file recursively.
Just rename your db.changelog-master.yaml
under test path to db.changelog-master-test.yaml
ok, it's working now, but the problem that it starts with files from test, and then i get an exception, cause there are no tables, which will create in main
– Anton Barinov
Nov 16 '18 at 12:52
add a comment |
I would suggest to name changelog file located in test path differently, because during test, main
/test
paths are merged into one relative path for the test suite run. I suspect Liquibase thinks that you are trying to include same file recursively.
Just rename your db.changelog-master.yaml
under test path to db.changelog-master-test.yaml
I would suggest to name changelog file located in test path differently, because during test, main
/test
paths are merged into one relative path for the test suite run. I suspect Liquibase thinks that you are trying to include same file recursively.
Just rename your db.changelog-master.yaml
under test path to db.changelog-master-test.yaml
answered Nov 16 '18 at 12:42
luboskrnacluboskrnac
16.1k54874
16.1k54874
ok, it's working now, but the problem that it starts with files from test, and then i get an exception, cause there are no tables, which will create in main
– Anton Barinov
Nov 16 '18 at 12:52
add a comment |
ok, it's working now, but the problem that it starts with files from test, and then i get an exception, cause there are no tables, which will create in main
– Anton Barinov
Nov 16 '18 at 12:52
ok, it's working now, but the problem that it starts with files from test, and then i get an exception, cause there are no tables, which will create in main
– Anton Barinov
Nov 16 '18 at 12:52
ok, it's working now, but the problem that it starts with files from test, and then i get an exception, cause there are no tables, which will create in main
– Anton Barinov
Nov 16 '18 at 12:52
add a comment |
We include SQL files this way:
- sqlFile:
encoding: utf8
path: /db/changelog/schema/schema.sql
So try to add slash at the beginning.
no, it doesn' help
– Anton Barinov
Nov 16 '18 at 12:36
add a comment |
We include SQL files this way:
- sqlFile:
encoding: utf8
path: /db/changelog/schema/schema.sql
So try to add slash at the beginning.
no, it doesn' help
– Anton Barinov
Nov 16 '18 at 12:36
add a comment |
We include SQL files this way:
- sqlFile:
encoding: utf8
path: /db/changelog/schema/schema.sql
So try to add slash at the beginning.
We include SQL files this way:
- sqlFile:
encoding: utf8
path: /db/changelog/schema/schema.sql
So try to add slash at the beginning.
answered Nov 16 '18 at 12:23
luboskrnacluboskrnac
16.1k54874
16.1k54874
no, it doesn' help
– Anton Barinov
Nov 16 '18 at 12:36
add a comment |
no, it doesn' help
– Anton Barinov
Nov 16 '18 at 12:36
no, it doesn' help
– Anton Barinov
Nov 16 '18 at 12:36
no, it doesn' help
– Anton Barinov
Nov 16 '18 at 12:36
add a comment |
Give the full path instead of ../../main/resources/db/changelog/db.changelog-master.yaml
compiler is not able to parse the path in .. format.
Below is enough to load file if the file is present in classpath otherwise give full project context path.
db/changelog/db.changelog-master.yaml
I couldn't just hard code the full path of my system, it makes no sence. And it's not in the classpath
– Anton Barinov
Nov 16 '18 at 12:23
here full path is not system path it is project context path.
– Alien
Nov 16 '18 at 12:24
add a comment |
Give the full path instead of ../../main/resources/db/changelog/db.changelog-master.yaml
compiler is not able to parse the path in .. format.
Below is enough to load file if the file is present in classpath otherwise give full project context path.
db/changelog/db.changelog-master.yaml
I couldn't just hard code the full path of my system, it makes no sence. And it's not in the classpath
– Anton Barinov
Nov 16 '18 at 12:23
here full path is not system path it is project context path.
– Alien
Nov 16 '18 at 12:24
add a comment |
Give the full path instead of ../../main/resources/db/changelog/db.changelog-master.yaml
compiler is not able to parse the path in .. format.
Below is enough to load file if the file is present in classpath otherwise give full project context path.
db/changelog/db.changelog-master.yaml
Give the full path instead of ../../main/resources/db/changelog/db.changelog-master.yaml
compiler is not able to parse the path in .. format.
Below is enough to load file if the file is present in classpath otherwise give full project context path.
db/changelog/db.changelog-master.yaml
edited Nov 16 '18 at 12:29
answered Nov 16 '18 at 12:20
AlienAlien
5,52331128
5,52331128
I couldn't just hard code the full path of my system, it makes no sence. And it's not in the classpath
– Anton Barinov
Nov 16 '18 at 12:23
here full path is not system path it is project context path.
– Alien
Nov 16 '18 at 12:24
add a comment |
I couldn't just hard code the full path of my system, it makes no sence. And it's not in the classpath
– Anton Barinov
Nov 16 '18 at 12:23
here full path is not system path it is project context path.
– Alien
Nov 16 '18 at 12:24
I couldn't just hard code the full path of my system, it makes no sence. And it's not in the classpath
– Anton Barinov
Nov 16 '18 at 12:23
I couldn't just hard code the full path of my system, it makes no sence. And it's not in the classpath
– Anton Barinov
Nov 16 '18 at 12:23
here full path is not system path it is project context path.
– Alien
Nov 16 '18 at 12:24
here full path is not system path it is project context path.
– Alien
Nov 16 '18 at 12:24
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337527%2fliquibase-link-main-yaml-changelog-from-test%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Error parsing...
. I bet there will be narrowed message about what exactly cannot be parsed.– luboskrnac
Nov 16 '18 at 12:26
@luboskrnac added error trace
– Anton Barinov
Nov 16 '18 at 12:34