diff --git a/maven-project-crawler/error_code_config.yml b/maven-project-crawler/error_code_config.yml index 867099b3..cf122110 100644 --- a/maven-project-crawler/error_code_config.yml +++ b/maven-project-crawler/error_code_config.yml @@ -2,4 +2,4 @@ error-tags: PK-MPC: packages: - com.exasol.projectkeeper - highest-index: 63 \ No newline at end of file + highest-index: 64 diff --git a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java index f8266227..d257fa98 100644 --- a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java +++ b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java @@ -39,6 +39,11 @@ public class MavenProjectCrawlerMojo extends AbstractMojo { // [impl -> dsn~eclipse-prefs-java-version~1] @Override public void execute() { + if (this.projectsToCrawl == null || this.projectsToCrawl.isBlank()) { + throw new IllegalArgumentException(ExaError.messageBuilder("E-PK-MPC-64") + .message("Property {{property name}} is not defined or empty.", PROPERTY_PROJECTS_TO_CRAWL) + .mitigation("Specify property with least one pom file.").toString()); + } final MavenProjectFromFileReader mavenProjectReader = new DefaultMavenProjectFromFileReader( this.mavenProjectBuilder, this.session); final MavenModelFromRepositoryReader modelFromRepositoryReader = new MavenModelFromRepositoryReader( diff --git a/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperFixMojo.java b/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperFixMojo.java index 38fddf9a..5f310cea 100644 --- a/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperFixMojo.java +++ b/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperFixMojo.java @@ -6,7 +6,7 @@ import com.exasol.projectkeeper.ProjectKeeper; /** - * Entry point for the fix goal. + * Entry point for the {@code fix} goal. *

* Run using {@code mvn project-keeper:fix} *

diff --git a/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperVerifyMojo.java b/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperVerifyMojo.java index 2524c634..e28c1875 100644 --- a/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperVerifyMojo.java +++ b/project-keeper-maven-plugin/src/main/java/com/exasol/projectkeeper/plugin/ProjectKeeperVerifyMojo.java @@ -7,7 +7,7 @@ import com.exasol.projectkeeper.ProjectKeeper; /** - * Entry point for the verify goal. + * Entry point for the {code verify} goal. *

* Run using {@code mvn project-keeper:verify} *

diff --git a/project-keeper-maven-plugin/src/test/java/com/exasol/projectkeeper/plugin/MvnProjectWithProjectKeeperPluginWriter.java b/project-keeper-maven-plugin/src/test/java/com/exasol/projectkeeper/plugin/MvnProjectWithProjectKeeperPluginWriter.java index 45437f20..11953af5 100644 --- a/project-keeper-maven-plugin/src/test/java/com/exasol/projectkeeper/plugin/MvnProjectWithProjectKeeperPluginWriter.java +++ b/project-keeper-maven-plugin/src/test/java/com/exasol/projectkeeper/plugin/MvnProjectWithProjectKeeperPluginWriter.java @@ -1,34 +1,61 @@ package com.exasol.projectkeeper.plugin; -import java.io.FileWriter; -import java.io.IOException; +import java.io.*; import java.nio.file.Path; import java.util.List; import org.apache.maven.model.*; import org.apache.maven.model.io.xpp3.MavenXpp3Writer; +import org.codehaus.plexus.util.xml.Xpp3Dom; -public class MvnProjectWithProjectKeeperPluginWriter extends Model { - private static final long serialVersionUID = -8757020322006895512L; +public class MvnProjectWithProjectKeeperPluginWriter { public static final String PROJECT_ARTIFACT_ID = "my-test-project"; public static final String PROJECT_VERSION = "0.1.0"; + private final Model model; public MvnProjectWithProjectKeeperPluginWriter(final String projectKeeperVersion) { - this.setBuild(new Build()); - this.setVersion(PROJECT_VERSION); - this.setArtifactId(PROJECT_ARTIFACT_ID); - this.setGroupId("com.exasol"); - this.setModelVersion("4.0.0"); - this.setDescription("my project description"); + this.model = new Model(); + this.model.setBuild(new Build()); + this.model.setVersion(PROJECT_VERSION); + this.model.setArtifactId(PROJECT_ARTIFACT_ID); + this.model.setGroupId("com.exasol"); + this.model.setModelVersion("4.0.0"); + this.model.setDescription("my project description"); addProjectKeeperPlugin(projectKeeperVersion); } - public void writeAsPomToProject(final Path projectDir) throws IOException { - try (final FileWriter fileWriter = new FileWriter(projectDir.resolve("pom.xml").toFile())) { - new MavenXpp3Writer().write(fileWriter, this); + public void writeAsPomToProject(final Path projectDir) { + final Path path = projectDir.resolve("pom.xml"); + try (final FileWriter fileWriter = new FileWriter(path.toFile())) { + new MavenXpp3Writer().write(fileWriter, this.model); + } catch (final IOException exception) { + throw new UncheckedIOException("Failed writing POM to file " + path, exception); } } + public MvnProjectWithProjectKeeperPluginWriter addDependency(final String groupId, final String artifactId, + final String version) { + final Dependency dependency = new Dependency(); + dependency.setGroupId(groupId); + dependency.setArtifactId(artifactId); + dependency.setVersion(version); + this.model.getDependencies().add(dependency); + return this; + } + + public MvnProjectWithProjectKeeperPluginWriter setArtifactFinalName(final String finalName) { + final Plugin plugin = new Plugin(); + plugin.setGroupId("org.apache.maven.plugins"); + plugin.setArtifactId("maven-assembly-plugin"); + final Xpp3Dom configuration = new Xpp3Dom("configuration"); + final Xpp3Dom finalNameElement = new Xpp3Dom("finalName"); + finalNameElement.setValue(finalName); + configuration.addChild(finalNameElement); + plugin.setConfiguration(configuration); + this.model.getBuild().addPlugin(plugin); + return this; + } + private void addProjectKeeperPlugin(final String version) { final Plugin projectKeeperPlugin = new Plugin(); projectKeeperPlugin.setGroupId("com.exasol"); @@ -37,6 +64,6 @@ private void addProjectKeeperPlugin(final String version) { final PluginExecution execution = new PluginExecution(); execution.setGoals(List.of("verify")); projectKeeperPlugin.setExecutions(List.of(execution)); - this.getBuild().addPlugin(projectKeeperPlugin); + this.model.getBuild().addPlugin(projectKeeperPlugin); } } diff --git a/project-keeper/error_code_config.yml b/project-keeper/error_code_config.yml index e550c0e8..53d3c5ac 100644 --- a/project-keeper/error_code_config.yml +++ b/project-keeper/error_code_config.yml @@ -2,4 +2,4 @@ error-tags: PK-CORE: packages: - com.exasol.projectkeeper - highest-index: 170 + highest-index: 179 diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/JavaProjectCrawlerRunner.java b/project-keeper/src/main/java/com/exasol/projectkeeper/JavaProjectCrawlerRunner.java index 3c4449ee..18dcf1ed 100644 --- a/project-keeper/src/main/java/com/exasol/projectkeeper/JavaProjectCrawlerRunner.java +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/JavaProjectCrawlerRunner.java @@ -1,36 +1,28 @@ package com.exasol.projectkeeper; -import java.io.IOException; -import java.io.UncheckedIOException; import java.nio.file.FileSystems; import java.nio.file.Path; import java.time.Duration; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.Arrays; import java.util.stream.Collectors; -import com.exasol.errorreporting.ExaError; -import com.exasol.projectkeeper.OsCheck.OSType; import com.exasol.projectkeeper.shared.mavenprojectcrawler.MavenProjectCrawlResult; import com.exasol.projectkeeper.shared.mavenprojectcrawler.ResponseCoder; -import com.exasol.projectkeeper.stream.AsyncStreamReader; -import com.exasol.projectkeeper.stream.CollectingConsumer; +import com.exasol.projectkeeper.sources.analyze.generic.MavenProcessBuilder; +import com.exasol.projectkeeper.sources.analyze.generic.SimpleProcess; /** * Runs the maven plugin goal on the current repository and returns the parsed result. */ public class JavaProjectCrawlerRunner { - private static final Logger LOGGER = Logger.getLogger(JavaProjectCrawlerRunner.class.getName()); - private static final Duration STREAM_READING_TIMEOUT = Duration.ofSeconds(1); private final Path mvnRepositoryOverride; private final String ownVersion; /** * Create a new instance of {@link JavaProjectCrawlerRunner}. * - * @param mvnRepositoryOverride maven repository override. Use {@code null} for default + * @param mvnRepositoryOverride Maven repository override. This is useful for running integration tests. Use + * {@code null} for default. * @param ownVersion project-keeper version */ public JavaProjectCrawlerRunner(final Path mvnRepositoryOverride, final String ownVersion) { @@ -50,67 +42,39 @@ public MavenProjectCrawlResult crawlProject(final Path... pomFiles) { } private String runCrawlerPlugin(final Path... pomFiles) { - final String projectList = Arrays.stream(pomFiles).map(pomFile -> pomFile.toAbsolutePath().toString() - // we use / instead of \ here as a fix for https://github.com/eclipse-ee4j/yasson/issues/540 - .replace(FileSystems.getDefault().getSeparator(), "/")).collect(Collectors.joining(";")); - try { - final List commandParts = new ArrayList<>(List.of(getMavenExecutable(), "--batch-mode", - "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn", - "com.exasol:project-keeper-java-project-crawler:" + this.ownVersion + ":" + "crawl", - "-DprojectsToCrawl=" + projectList, - /* - * We need to disable the model cache here since it caches the parent poms with {revision} as - * version and then runs into trouble since the cache is different when reading the old pom (for - * comparing dependencies). - */ - "-Dmaven.defaultProjectBuilder.disableGlobalModelCache=true")); - if (this.mvnRepositoryOverride != null) { - commandParts.add("-Dmaven.repo.local=" + this.mvnRepositoryOverride); - } - - LOGGER.fine(() -> "Executing command " + commandParts); - final Process proc = new ProcessBuilder(commandParts).redirectErrorStream(true).start(); + final MavenProcessBuilder builder = buildMavenCommand(pomFiles); + final SimpleProcess process = builder.startSimpleProcess(); + process.waitUntilFinished(Duration.ofSeconds(90)); + return new ResponseCoder().decodeResponse(process.getOutputStreamContent()); + } - final CollectingConsumer outputStreamConsumer = new AsyncStreamReader() - .startCollectingConsumer(proc.getInputStream()); - final CollectingConsumer errorStreamConsumer = new AsyncStreamReader() - .startCollectingConsumer(proc.getErrorStream()); + private MavenProcessBuilder buildMavenCommand(final Path... pomFiles) { + final MavenProcessBuilder builder = MavenProcessBuilder.create() + .addArguments( + "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn", + "com.exasol:project-keeper-java-project-crawler:" + this.ownVersion + ":" + "crawl", + "-DprojectsToCrawl=" + getProjectList(pomFiles), + /* + * We need to disable the model cache here since it caches the parent poms with {revision} as + * version and then runs into trouble since the cache is different when reading the old pom (for + * comparing dependencies). + */ + "-Dmaven.defaultProjectBuilder.disableGlobalModelCache=true") + .workingDir(null); - if (!proc.waitFor(90, TimeUnit.SECONDS)) { - final String stdOutput = outputStreamConsumer.getCurrentContent(); - final String stdError = errorStreamConsumer.getCurrentContent(); - throw new IllegalStateException(ExaError.messageBuilder("E-PK-CORE-81").message( - "Timeout while executing command {{executed command|u}}. Output: {{std output}}, error: {{std error}}", - commandParts, stdOutput, stdError).toString()); - } - final int exitCode = proc.exitValue(); - final String output = outputStreamConsumer.getContent(STREAM_READING_TIMEOUT); - if (exitCode != 0) { - LOGGER.log(Level.SEVERE, output); - throw new IllegalStateException(ExaError.messageBuilder("E-PK-CORE-78").message( - "Failed to run command {{executed command|u}}, exit code was {{exit code}}. Output:\n{{output}}", - commandParts, exitCode, output).toString()); - } - return new ResponseCoder().decodeResponse(output); - } catch (final IOException exception) { - throw new UncheckedIOException(getRunFailedMessage(), exception); - } catch (final InterruptedException exception) { - Thread.currentThread().interrupt(); - throw new IllegalStateException(getRunFailedMessage(), exception); + if (this.mvnRepositoryOverride != null) { + builder.addArgument("-Dmaven.repo.local=" + this.mvnRepositoryOverride); } + return builder; } - private String getMavenExecutable() { - final OSType osType = new OsCheck().getOperatingSystemType(); - if (osType == OSType.WINDOWS) { - return "mvn.cmd"; - } else { - return "mvn"; - } + private String getProjectList(final Path... pomFiles) { + return Arrays.stream(pomFiles).map(this::formatPath).collect(Collectors.joining(";")); } - private String getRunFailedMessage() { - return ExaError.messageBuilder("E-PK-CORE-80").message("Failed to run project-keeper-java-project-crawler.") - .toString(); + private String formatPath(final Path pomFile) { + return pomFile.toAbsolutePath().toString() + // we use / instead of \ here as a fix for https://github.com/eclipse-ee4j/yasson/issues/540 + .replace(FileSystems.getDefault().getSeparator(), "/"); } } diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/generic/MavenProcessBuilder.java b/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/generic/MavenProcessBuilder.java new file mode 100644 index 00000000..d7024931 --- /dev/null +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/generic/MavenProcessBuilder.java @@ -0,0 +1,80 @@ +package com.exasol.projectkeeper.sources.analyze.generic; + +import static java.util.Arrays.asList; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +import com.exasol.projectkeeper.OsCheck; +import com.exasol.projectkeeper.OsCheck.OSType; + +/** + * This class allows building and starting a {@code mvn} command. + */ +public class MavenProcessBuilder { + private final List command = new ArrayList<>(); + private Path workingDir = null; + + private MavenProcessBuilder() { + // Use create() method + } + + /** + * Create a new builder. + * + * @return new builder + */ + public static MavenProcessBuilder create() { + final MavenProcessBuilder builder = new MavenProcessBuilder(); + builder.addArgument(getMavenExecutable()); + builder.addArgument("--batch-mode"); + return builder; + } + + /** + * Add the given arguments to the command. + * + * @param arguments arguments to add + * @return {@code this} for fluent programming + */ + public MavenProcessBuilder addArguments(final String... arguments) { + command.addAll(asList(arguments)); + return this; + } + + /** + * Add the given argument to the command. + * + * @param argument argument to add + * @return {@code this} for fluent programming + */ + public MavenProcessBuilder addArgument(final String argument) { + command.add(argument); + return this; + } + + /** + * Define the working directory where to execute the command. Default: {@code null}. + * + * @param workingDir working dir + * @return {@code this} for fluent programming + */ + public MavenProcessBuilder workingDir(final Path workingDir) { + this.workingDir = workingDir; + return this; + } + + /** + * Build the command and run it. + * + * @return the running {@link SimpleProcess} + */ + public SimpleProcess startSimpleProcess() { + return SimpleProcess.start(workingDir, command); + } + + private static String getMavenExecutable() { + return "mvn" + OsCheck.suffix(".cmd"); + } +} diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidator.java b/project-keeper/src/main/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidator.java index c7e457c1..afd5cb05 100644 --- a/project-keeper/src/main/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidator.java +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidator.java @@ -7,7 +7,7 @@ import com.exasol.errorreporting.ExaError; import com.exasol.projectkeeper.Validator; import com.exasol.projectkeeper.validators.VersionCollector; -import com.exasol.projectkeeper.validators.changesfile.ChangesFile.Filename; +import com.exasol.projectkeeper.validators.changesfile.ChangesFile; import com.exasol.projectkeeper.validators.finding.SimpleValidationFinding; import com.exasol.projectkeeper.validators.finding.ValidationFinding; @@ -32,11 +32,11 @@ public LatestChangesFileValidator(final Path projectDir, final String projectVer @Override public List validate() { final List empty = Collections.emptyList(); - final List list = new VersionCollector(this.projectDirectory).collectChangesFiles(); + final List list = new VersionCollector(this.projectDirectory).collectChangesFiles(); if (list.isEmpty()) { return empty; } - final Filename latest = list.get(0); + final ChangesFile.Filename latest = list.get(0); if (latest.version().equals(this.projectVersion)) { return empty; } diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/JavaProjectCrawlerRunnerIT.java b/project-keeper/src/test/java/com/exasol/projectkeeper/JavaProjectCrawlerRunnerIT.java index 0d378c26..ea11a2c7 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/JavaProjectCrawlerRunnerIT.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/JavaProjectCrawlerRunnerIT.java @@ -2,8 +2,9 @@ import static com.exasol.projectkeeper.shared.dependencies.BaseDependency.Type.COMPILE; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.io.FileWriter; import java.io.IOException; @@ -44,8 +45,7 @@ void testGetDependencyChanges(@TempDir final Path tempDir) throws GitAPIExceptio Git.init().setDirectory(tempDir.toFile()).call().close(); final Path pomFile = tempDir.resolve("pom.xml"); writePomFile(pomFile); - final MavenProjectCrawlResult result = new JavaProjectCrawlerRunner(testMavenRepo, - TestEnvBuilder.CURRENT_VERSION).crawlProject(pomFile); + final MavenProjectCrawlResult result = crawlProject(pomFile); final CrawledMavenProject mavenProject = result.getCrawledProjects() .get(pomFile.toAbsolutePath().toString().replace("\\", "/")); final ProjectDependency expectedDependency = ProjectDependency.builder() // @@ -63,6 +63,26 @@ void testGetDependencyChanges(@TempDir final Path tempDir) throws GitAPIExceptio ); } + MavenProjectCrawlResult crawlProject(final Path... pomFiles) { + return new JavaProjectCrawlerRunner(testMavenRepo, TestEnvBuilder.CURRENT_VERSION).crawlProject(pomFiles); + } + + @Test + void testGetDependencyChangesFailsForEmptyPomList() throws GitAPIException, IOException { + final IllegalStateException exception = assertThrows(IllegalStateException.class, () -> crawlProject()); + assertThat(exception.getMessage(), containsString( + "E-PK-MPC-64: Property 'projectsToCrawl' is not defined or empty. Specify property with least one pom file.")); + } + + @Test + void testGetDependencyChangesFailsForMissingPom() throws GitAPIException, IOException { + final Path missingPomFile = Path.of("missing-pom-file"); + final IllegalStateException exception = assertThrows(IllegalStateException.class, + () -> this.crawlProject(missingPomFile)); + assertThat(exception.getMessage(), + allOf(containsString("[FATAL] Non-readable POM"), containsString(missingPomFile.toString()))); + } + private void writePomFile(final Path pomFile) throws IOException { final TestMavenModel model = new TestMavenModel(); model.addDependency(DEPENDENCY_ID, DEPENDENCY_GROUP, "", DEPENDENCY_VERSION); @@ -70,4 +90,4 @@ private void writePomFile(final Path pomFile) throws IOException { new MavenXpp3Writer().write(fileWriter, model); } } -} \ No newline at end of file +} diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/MavenSourceAnalyzerTest.java b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/MavenSourceAnalyzerTest.java index 3af17dca..9bef4677 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/MavenSourceAnalyzerTest.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/MavenSourceAnalyzerTest.java @@ -30,7 +30,7 @@ void analyzingSourcesWithInvalidOwnVersionFails() { final IllegalStateException exception = assertThrows(IllegalStateException.class, () -> analyze(OWN_VERSION, mavenSources)); assertThat(exception.getMessage(), - allOf(containsString("E-PK-CORE-78: Failed to run command"), + allOf(containsString("E-PK-CORE-126: Failed to run command"), containsString("[ERROR] Plugin com.exasol:project-keeper-java-project-crawler:" + OWN_VERSION + " or one of its dependencies could not be resolved"))); } diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/generic/SimpleProcessIT.java b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/generic/SimpleProcessIT.java index 9a8c7b81..1c9828cc 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/generic/SimpleProcessIT.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/generic/SimpleProcessIT.java @@ -11,11 +11,11 @@ import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; -// Windows has problems with the timeout of 10ms. Running these tests under Unix is enough. +// Windows has problems with the timeout of 20ms. Running these tests under Unix is enough. @DisabledOnOs(OS.WINDOWS) class SimpleProcessIT { - private static final Duration TIMEOUT = Duration.ofMillis(10); + private static final Duration TIMEOUT = Duration.ofMillis(20); @Test void outputStream() { @@ -60,7 +60,7 @@ void processTimeout() { final IllegalStateException exception = assertThrows(IllegalStateException.class, () -> process.waitUntilFinished(TIMEOUT)); assertThat(exception.getMessage(), equalTo( - "E-PK-CORE-128: Timeout while waiting 10ms for command 'bash -c echo output && >&2 echo error && sleep 1'. Output was 'output'\n" + "E-PK-CORE-128: Timeout while waiting 20ms for command 'bash -c echo output && >&2 echo error && sleep 1'. Output was 'output'\n" + "Error output: 'error'")); } diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidatorTest.java b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidatorTest.java index 404adc38..a030479a 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidatorTest.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/LatestChangesFileValidatorTest.java @@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import com.exasol.projectkeeper.validators.changesfile.ChangesFile.Filename; +import com.exasol.projectkeeper.validators.changesfile.ChangesFile; import com.exasol.projectkeeper.validators.finding.SimpleValidationFinding; class LatestChangesFileValidatorTest { @@ -38,7 +38,7 @@ private LatestChangesFileValidator testee(final Path tempDir, final String... ve final Path folder = tempDir.resolve(Path.of("doc", "changes")); Files.createDirectories(folder); for (final String v : versions) { - final Filename cfile = new Filename(v); + final ChangesFile.Filename cfile = new ChangesFile.Filename(v); Files.createFile(folder.resolve(cfile.filename())); } return new LatestChangesFileValidator(tempDir, "2.0.0"); diff --git a/project-keeper/src/test/resources/changesFileExample1.md b/project-keeper/src/test/resources/changesFileExample1.md index 4791e2ef..49211dfd 100644 --- a/project-keeper/src/test/resources/changesFileExample1.md +++ b/project-keeper/src/test/resources/changesFileExample1.md @@ -49,4 +49,3 @@ My summary * Added `::` * Updated `::` to `` * Removed `::` - diff --git a/shared-model-classes/error_code_config.yml b/shared-model-classes/error_code_config.yml index febfbc52..eec657cd 100644 --- a/shared-model-classes/error_code_config.yml +++ b/shared-model-classes/error_code_config.yml @@ -2,4 +2,4 @@ error-tags: PK-SMC: packages: - com.exasol.projectkeeper - highest-index: 81 \ No newline at end of file + highest-index: 81