mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

Support the '-Amapstruct.unmappedTargetPolicy' config of maven-compiler-plugin

Open WangXiaoJin opened this issue 2 years ago • 1 comments

When I use the -Amapstruct.unmappedTargetPolicy=IGNORE config in maven-compiler-plugin , mapstruct-idea don't understand this config, and the IDEA still throw warn msg 'Unmapped target properties'.

pom.xml

<pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <parameters>true</parameters>
            <annotationProcessorPaths>
              <path>
                <groupId>com.github.therapi</groupId>
                <artifactId>therapi-runtime-javadoc-scribe</artifactId>
                <version>${therapi-runtime-javadoc-scribe.version}</version>
              </path>
              <path>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
                <version>${spring-boot.version}</version>
              </path>
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
              </path>
              <path>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
              </path>
            </annotationProcessorPaths>
            <showWarnings>true</showWarnings>
          </configuration>
          <executions>
            <execution>
              <id>default-compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <compilerArgs>
                  <arg>
                    -Amapstruct.unmappedTargetPolicy=IGNORE
                  </arg>
                </compilerArgs>
              </configuration>
            </execution>
          </executions>
        </plugin>
    </plugins>
</pluginManagement>

image

WangXiaoJin avatar Jul 15 '23 01:07 WangXiaoJin

This is a good enhancement for the project. Are you interested in contributing this to the project @WangXiaoJin?

I am not sure how we can access the maven compiler compiler arguments and how this works with gradle projects. So if someone has an idea, please let us know

filiphr avatar Jul 29 '23 12:07 filiphr