Comments (1)
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)
- Mapping fields to nested object using custom method HOT 5
- Add a more prominent link to the GitHub project HOT 3
- Add information about Lombok Mapstruct Binding Module to Mapstruct documentation HOT 1
- IDE Support: VScode HOT 1
- Broken links in TOC of MapStruct site FAQ HOT 3
- defaultValue is not work. how to fix it ; HOT 2
- How to copy attributes of the same class using Mapstruct HOT 1
- Do I have to use Mapstruct with Lombok? I didn't introduce Lombok into my project. I wrote get and set manually, but it reminded me that I couldn't find attributes. HOT 2
- Other languages support HOT 4
- A syntax error?
- Link to technical documentation is broken HOT 3
- mapstruct-jdk8 homepage link incorrect in pom.xml HOT 1
- java.lang.ClassNotFoundException: Cannot find implementation for HOT 1
- cannot generate the implementation for eclipse HOT 4
- Correct reference guide links HOT 6
- final value containers HOT 1
- How to Map to Generic Type? HOT 1
- plexus-contaner-default should be removed
- Use latest version of Hugo
- eclipse HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapstruct.org.