Coder Social home page Coder Social logo

Comments (1)

agudian avatar agudian commented on June 4, 2024

That is most probably a problem with how the pom is set up - the classes should only be generated once. I bet the mapstruct-processor module ended up on the compile classpath, which is then picked up automatically by the java compiler. My tip would be to set up your pom like it's described in our latest docs: http://mapstruct.org/documentation/1.1/reference/html/index.html#setup

...
<properties>
    <org.mapstruct.version>1.1.0.Beta1</org.mapstruct.version>
    <m2e.apt.activation>jdt_apt</m2e.apt.activation>
</properties>
...
<dependencies>
    <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct-jdk8</artifactId>
        <version>${org.mapstruct.version}</version>
    </dependency>
</dependencies>
...
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <annotationProcessorPaths>
                    <path>
                        <groupId>org.mapstruct</groupId>
                        <artifactId>mapstruct-processor</artifactId>
                        <version>${org.mapstruct.version}</version>
                    </path>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</build>
...

If you then also have the latest Eclipse m2e-apt plugin installed, then the annotation processor within Eclipse will be configured correctly and you won't have any trouble either in maven or in eclipse.

Regarding your other points, I don't get what you mean with 1) and hence can't see what's missing in the docs or the examples. Could you give us some more information on what you have and what you want to accomplish?
Point 3) is by design - used mappers are not propaged transitively. But you can define commonly used mappers in an @MappingConfig annotated class and reference it in your mapper.
Finally, the MapStruct Eclipse Plugin is not supposed to set up the eclipse compiler settings based on your pom - that's what m2e-apt is for. Perhaps we should make that more clear in readme of the plugin.

I'm closing this issue now. If you want to continue discussing your points, please open up a mail thread in our mapstruct-users mailing list. For actual issues or feature requests, https://github.com/mapstruct/mapstruct/issues is the right place for them. This repository / issue tracker is for the pages and documentation on mapstruct.org only.
Thanks!

from mapstruct.org.

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.