Git Plugin Config: Gets rid of maven warning.

Mapstruct "attributes" not mapped -> Field of HAL base class should be
ignored.
This commit is contained in:
Johannes Schnatterer
2018-08-02 10:53:13 +02:00
parent 7fd944357d
commit 79f807e809
3 changed files with 6 additions and 2 deletions

View File

@@ -13,10 +13,11 @@ import java.io.File;
@Setter
public class GitConfigDto extends HalRepresentation {
private String gcExpression;
private File repositoryDirectory;
private boolean disabled = false;
private String gcExpression;
@Override
protected HalRepresentation add(Links links) {
return super.add(links);

View File

@@ -30,7 +30,8 @@ public class GitConfigResource {
private final GitRepositoryHandler repositoryHandler;
@Inject
public GitConfigResource(GitConfigDtoToGitConfigMapper dtoToConfigMapper, GitConfigToGitConfigDtoMapper configToDtoMapper, GitRepositoryHandler repositoryHandler) {
public GitConfigResource(GitConfigDtoToGitConfigMapper dtoToConfigMapper, GitConfigToGitConfigDtoMapper configToDtoMapper,
GitRepositoryHandler repositoryHandler) {
this.dtoToConfigMapper = dtoToConfigMapper;
this.configToDtoMapper = configToDtoMapper;
this.repositoryHandler = repositoryHandler;

View File

@@ -3,6 +3,7 @@ package sonia.scm.api.v2.resources;
import de.otto.edison.hal.Links;
import org.mapstruct.AfterMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import sonia.scm.config.ConfigurationPermissions;
import sonia.scm.repository.GitConfig;
@@ -20,6 +21,7 @@ public abstract class GitConfigToGitConfigDtoMapper {
@Inject
private UriInfoStore uriInfoStore;
@Mapping(target = "attributes", ignore = true) // We do not map HAL attributes
public abstract GitConfigDto map(GitConfig config);
@AfterMapping