io.github.devsecops.engine.domain.pom.commands.PomIncreaseVersionCommand Maven / Gradle / Ivy
package io.github.devsecops.engine.domain.pom.commands;
import io.github.devsecops.engine.core.contract.Command;
import io.github.devsecops.engine.domain.pom.model.Pom;
import io.github.devsecops.engine.domain.pom.model.SemanticVersion;
import org.springframework.stereotype.Component;
@Component
public class PomIncreaseVersionCommand implements Command {
@Override
public void execute() throws Exception {
Pom pom = Pom.getINSTANCE();
pom.getSemanticVersion().map(SemanticVersion::incrementPatch).map(SemanticVersion::toString).ifPresent(pom::updateVersion);
}
@Override
public void rollback() throws Exception {
throw new UnsupportedOperationException("No rollback is specified for artifact commands");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy