mapstruct / mapstruct-idea

An IntelliJ IDEA plugin for working with MapStruct
Other
141 stars 38 forks source link

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

Open WangXiaoJin opened 1 year ago

WangXiaoJin commented 1 year ago

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

filiphr commented 1 year ago

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