Code Monkey home page Code Monkey logo

Comments (9)

vincent-fuchs avatar vincent-fuchs commented on August 22, 2024

Thanks for this request !

Indeed, it could be interesting to set have an optional parameter in the config, to give a list of folders to ignore. We would have to implement it in https://github.com/societe-generale/arch-unit-build-plugin-core though.

I faced the exact same issue, but found a workaround. Maybe it's not the same issue, but I'll mention the workaround anyway :

By default, Lombok will generate getters on collections that don't have the javax.annotation.Nonnull annotation. And I had DontReturnNullCollectionTest rule raising violations.

To avoid this, I found 2 solutions :

  • write the getter yourself for these fields : in that case you can make sure that null is never returned by testing it before returning the value, and returning an empty list if it is.

  • tweak the Lombok annotation, as described here : https://projectlombok.org/features/experimental/onX

     @Getter(onMethod_={@Nonnull})

But in that case, I am quite sure it's still possible that null is returned, even though the annotation says otherwise - so it may be misleading.

from arch-unit-maven-plugin.

daniel-shuy avatar daniel-shuy commented on August 22, 2024

Thanks. Unfortunately my issue is not with Lombok, but MapStruct, which has no way of configuring the generated methods.

from arch-unit-maven-plugin.

vincent-fuchs avatar vincent-fuchs commented on August 22, 2024

fixed in v2.4.0

from arch-unit-maven-plugin.

daniel-shuy avatar daniel-shuy commented on August 22, 2024

Still having this issue with arch-unit-maven-plugin 2.4.0 and arch-unit-build-plugin-core 2.5.2. Is there anything that I have to configure specifically?

from arch-unit-maven-plugin.

vincent-fuchs avatar vincent-fuchs commented on August 22, 2024

yes, I've added a new config parameter (see the documentation) :

<excludedPaths>
    <excludedPath>generated-sources</excludedPath>
</excludedPaths>

from arch-unit-maven-plugin.

daniel-shuy avatar daniel-shuy commented on August 22, 2024

Just tried with that, seems like it doesn't work either. It only seems to match the package name or class name, not the full path.

from arch-unit-maven-plugin.

vincent-fuchs avatar vincent-fuchs commented on August 22, 2024

Just tried with that, seems like it doesn't work either. It only seems to match the package name or class name, not the full path.

archUnit looks at the compiled code, not the source code. Do you know in which folder your generated-sources code gets compiled ? you could try to configure this directory instead

from arch-unit-maven-plugin.

daniel-shuy avatar daniel-shuy commented on August 22, 2024

archUnit looks at the compiled code, not the source code

Oh right, I forgot about that. Looks like there's no way I can just ignore all classes in generated-sources, as they are all compiled in their respective packages under target. The most I can do is to group all the MapStruct classes in the same package and ignore the package. Thanks.

from arch-unit-maven-plugin.

vincent-fuchs avatar vincent-fuchs commented on August 22, 2024

maybe you can change that behavior by tweaking the maven-compile plugin... but not sure !

from arch-unit-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.