diff --git a/eo-integration-tests/pom.xml b/eo-integration-tests/pom.xml index 81e1e8e6810..f0df0c72f3a 100644 --- a/eo-integration-tests/pom.xml +++ b/eo-integration-tests/pom.xml @@ -210,18 +210,6 @@ ${skipITs} ${skipITs} - - - fibonacci/pom.xml - diff --git a/eo-integration-tests/src/it/fibonacci/invoker.properties b/eo-integration-tests/src/it/fibonacci/invoker.properties index ba8dd0a6c0d..7ce821bc507 100644 --- a/eo-integration-tests/src/it/fibonacci/invoker.properties +++ b/eo-integration-tests/src/it/fibonacci/invoker.properties @@ -2,4 +2,4 @@ # SPDX-License-Identifier: MIT invoker.mavenOpts = -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -invoker.goals = clean test \ No newline at end of file +invoker.goals = clean test -X \ No newline at end of file diff --git a/eo-integration-tests/src/it/fibonacci/pom.xml b/eo-integration-tests/src/it/fibonacci/pom.xml index 8c201e45d4d..19893a8f216 100644 --- a/eo-integration-tests/src/it/fibonacci/pom.xml +++ b/eo-integration-tests/src/it/fibonacci/pom.xml @@ -34,11 +34,6 @@ - - maven-compiler-plugin - 3.8.1 - - maven-surefire-plugin @@ -61,20 +56,18 @@ @project.version@ + compile register - assemble + compile transpile - true - ${project.build.directory}/eo/foreign.csv - csv - ${project.build.directory}/eo/placed.json - json - true + true + false + true @@ -83,6 +76,7 @@ 3.6.2 + run-eo-fibonacci-app test java diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/MjTranspile.java b/eo-maven-plugin/src/main/java/org/eolang/maven/MjTranspile.java index 64209a06d9f..5254c7de2d3 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/MjTranspile.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/MjTranspile.java @@ -259,6 +259,9 @@ clazz, new FileGenerationReport(saved, tgt, target) * @param generated Path to generated sources * @return Amount of created files * @throws IOException If fails to create a file + * @todo #4717:90min Move {@link #pinfos(Path)} method to a separate class. + * Currently, this method violates Single Responsibility Principle of + * MjTranspile class. After moving, make sure to cover it with unit tests. */ private static int pinfos(final Path generated) throws IOException { final int size; @@ -269,7 +272,7 @@ private static int pinfos(final Path generated) throws IOException { for (final Path dir : dirs) { final String pkg = generated.relativize(dir).toString() .replace(File.separator, "."); - new Saved( + final Path saved = new Saved( String.join( "\n", "/**", @@ -284,9 +287,14 @@ private static int pinfos(final Path generated) throws IOException { ), dir.resolve("package-info.java") ).value(); + Logger.debug(MjTranspile.class, "Created %s", saved); } size = dirs.size(); } else { + Logger.info( + MjTranspile.class, + "No generated sources found, skipping package-info.java creation" + ); size = 0; } return size; diff --git a/eo-runtime/src/main/java/org/eolang/PhPackage.java b/eo-runtime/src/main/java/org/eolang/PhPackage.java index a27799eb268..f0b953e0a9a 100644 --- a/eo-runtime/src/main/java/org/eolang/PhPackage.java +++ b/eo-runtime/src/main/java/org/eolang/PhPackage.java @@ -122,6 +122,16 @@ public byte[] delta() { * Load phi object by package name from ClassLoader. * @param fqn FQN of the EO object * @return Phi + * @todo #4717:90min Check 'package-info.class' existence before looking for an object. + * Recently, we got an error when 'maven-compiler-plugin' removed 'package-info.class' + * during compilation and we got quite confusing error message: + * ``` + * Couldn't find object 'Φ.org.eolang.examples' because there's no class or package + * 'EOorg.EOeolang.EOexamples' EOorg.EOeolang.EOexamples + * ``` + * Having said that, the 'EOorg.EOeolang.EOexamples' package does exist. + * The error tells nothing about missing 'package-info.class'. We need to check for the + * existence of 'package-info.class' before trying to find an object. */ @SuppressWarnings("PMD.PreserveStackTrace") private Phi loadPhi(final String fqn) {