Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail when using non-default "target" folder #1330

Open
heyarny opened this issue Jul 15, 2024 · 1 comment
Open

Tests fail when using non-default "target" folder #1330

heyarny opened this issue Jul 15, 2024 · 1 comment

Comments

@heyarny
Copy link

heyarny commented Jul 15, 2024

It seems like all tests & validations are only working when using the default "target" maven folder.
As soon you change the target to something else, you get unwanted errors, because many packages and other settings match the tests itself.

Please add an option to define the target folder via maven config or even better: use ${project.build.directory} instead.

@codecholeric
Copy link
Collaborator

Can you give an example of what you mean? Or better a small project to reproduce this?
Principally ArchUnit usually just reads classes from the classpath, so it doesn't matter in which folder your classes reside, as long as the ClassLoader can find them.

If you refer to the predefined ImportOption DoNotIncludeTests (which indeed depends on a couple of default folders), then that's a known limitation. It's meant for the 99.999% of default cases where we can just assume a standard build tool layout. If you've reconfigured that, then you just need to create a custom ImportOption (you can peek into DoNotIncludeTests to copy & paste).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants