Fork me on GitHub
#leiningen
<
2019-09-18
>
manas_marthi13:09:44

hi all, How to configure Lein to use specifc maven profile?

metame18:09:48

Anyone around familiar with lein-monolith? Having issues with running tests. lein monolith each do test runs the tests for every subproject correctly lein monolith each :in my-service test doesn't work for 3/59 of our subprojects error: Could not resolve my-service to any monolith subproject!

greglook18:09:03

That’s surprising, what does your :project-dirs look like?

greglook18:09:32

you can use lein monolith info to see what projects it knows about

metame13:09:07

The project actually shows up in lein monolith info but when running lein monolith each :in my-service test I get the "Could not resolve" err.

metame18:09:40

any thoughts on what could cause this @U8XJ15DTK? Assumptions about what it should find when running?

greglook18:09:12

:thinking_face: might be good to make an issue for this on https://github.com/amperity/lein-monolith with some more of the context - let me peek at the code real quick

metame19:09:34

Okay will do

greglook19:09:26

out of curiosity, do your subprojects use artifact groups?

greglook19:09:25

the lookup logic is basically: - does the selector explicitly match a subproject group/name? - does the ‘condensed’ version of the name explicitly match a subproject group/name? (e.g. a bare (defproject foo ... is actually foo/foo but can be represented in the short form) - if the target has no group, does it match exactly one subproject name? - if not, unresolved

greglook19:09:43

step two seems like the highest probability for something odd happening

metame19:09:45

ok great questions. Let me do some homework and get back to you

metame19:09:40

so had the subproject name set as com.org.my-service changed it to and now it works

metame19:09:16

Same fix for all 3 services.

metame19:09:50

Is there a short explanation of what the difference between these are?

greglook19:09:54

@U774Z4VJA the short version is that the “group-id” is a shared namespace for many projects, while the “artifact-id” is the name of a specific project (or rather, the JAR and other artifacts produced for a project) - I don’t know if periods are legal name characters for artifact ids, which may have been part of the problem.

greglook19:09:49

In most cases the subprojects in a monorepo should probably all share the same group-id, though that’s not something that lein-monolith currently checks or enforces.

metame19:09:01

This is very helpful. Many thanks!!