Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

javancss-maven-plugin fails on java 8+ codebase #38

Closed
fbiville opened this issue Jun 26, 2019 · 17 comments · Fixed by #40
Closed

javancss-maven-plugin fails on java 8+ codebase #38

fbiville opened this issue Jun 26, 2019 · 17 comments · Fixed by #40

Comments

@fbiville
Copy link
Contributor

maven-project-info-reports-plugin 3.0 is not on Central, 3.0.0 is.
It's blocking mvn site from completing.

@fbiville
Copy link
Contributor Author

Here is what I had to change in Assertj-Neo4j to get the site to generate:

  1. remove all Java 8 (luckily, was just 3 lines of code to change)
  2. override the following plugins:
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>3.7.1</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>

+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>3.0.0</version>
+      </plugin>
+    </plugins>
+  </reporting>

fbiville pushed a commit to joel-costigliola/assertj-neo4j that referenced this issue Jun 26, 2019
2 main workarounds:

 - remove Java 8 code causing coverage plugins to fail
 - override plugins improperly set in parent POM (see
assertj/assertj-parent-pom#38)
@joel-costigliola
Copy link
Member

So all we need to do is to bump the version of these plugins ?

@fbiville
Copy link
Contributor Author

fbiville commented Jun 27, 2019

It seems the above changes work well for pre-Java 8 code.
If you got lambdas, method references etc... there will still be parsing errors.

@joel-costigliola
Copy link
Member

@fbiville we have just released assertj-parent-pom 2.2.4, can you give it a try to see if it solved your issue ?

@fbiville
Copy link
Contributor Author

fbiville commented Aug 5, 2019

@scordio fixed it joel-costigliola/assertj-neo4j@2667c3f :)

@fbiville
Copy link
Contributor Author

fbiville commented Aug 5, 2019

Oopsie, talked too fast:

cd $(mktemp -d) && \
    git clone https://github.com/joel-costigliola/assertj-neo4j.git && \
    mvn site -f assertj-neo4j

@fbiville
Copy link
Contributor Author

fbiville commented Aug 5, 2019

Now that Assertj Neo4j contains Java 8+ code again, the site cannot be generated.

@scordio scordio reopened this Aug 5, 2019
@joel-costigliola
Copy link
Member

joel-costigliola commented Aug 5, 2019

java 8 ? living on the edge @fbiville ? 😆

@scordio
Copy link
Member

scordio commented Aug 6, 2019

The missing support for Java 8 seems to be a JavaNCSS 33.54 issue used by javancss-maven-plugin. There is a pull request for it but no feedback for more than a year: codehaus/javancss#3

The fork from Nokia should have already the fix but I didn't find the updated artifact deployed anywhere.

As the only plugin I see for reporting is maven-project-info-reports-plugin, I guess it's the one responsible invoking the javancss-maven-plugin. Would it be an option to exclude the JavaNCSS report from its execution? (Not sure yet how to do it, I'll investigate a bit more later on)

@scordio
Copy link
Member

scordio commented Aug 6, 2019

javancss-maven-plugin is currently triggered by the parent POM, therefore the issue should happen in any child project. @joel-costigliola and @fbiville, how are assertj-core and assertj-neo4j different from mvn site point of view? I don't understand why this is not an issue for assertj-core.

@fbiville
Copy link
Contributor Author

fbiville commented Aug 7, 2019

I assume there is no Java 8+ syntax in assertj-core code yet?

@scordio
Copy link
Member

scordio commented Aug 7, 2019

There is a bunch of it :-) And the same issue is happening if I execute mvn site on assertj-core.

@joel-costigliola is javancss-maven-plugin really needed or can we get rid of it from the parent pom?

@fbiville
Copy link
Contributor Author

fbiville commented Aug 8, 2019

I'm currently in touch with Hervé Boutémy, Apache Maven committer. There may be a way to get Java 8 support into the Java NCSS. We'll have to wait for a few days when Hervé is back from vacation.

@fbiville
Copy link
Contributor Author

fbiville commented Aug 8, 2019

See codehaus/javancss#3 (comment)

@scordio
Copy link
Member

scordio commented Aug 9, 2019

I tried to create a PR on top of the existing code but there is at least one issue I am not able to solve, therefore I closed my PR (see codehaus/javancss#3 (comment))

@scordio scordio changed the title Wrong maven-project-info-reports-plugin version javancss-maven-plugin fails on java 8+ codebase Jan 18, 2020
@scordio
Copy link
Member

scordio commented Jan 2, 2021

Related: JavaNCSS/javancss#4

@scordio scordio changed the title javancss-maven-plugin fails on java 8+ codebase javancss-maven-plugin fails on java 8+ codebase Jan 9, 2022
@scordio
Copy link
Member

scordio commented Jul 28, 2022

javancss-maven-plugin has been removed in #156.

@scordio scordio closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants