%global debug_package %{nil} Name: javaparser Version: 3.28.0 Release: 1%{?dist} Summary: Java 1 to 13 Parser and Abstract Syntax Tree for Java License: LGPL-2.0-or-later OR Apache-2.0 URL: https://github.com/javaparser/javaparser Source0: %{url}/archive/javaparser-parent-%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: maven-local BuildRequires: java-17-openjdk-devel # RPM names (rather than mvn(group:artifact) capabilities) are used for the # external Maven plugins; both package the corresponding artifacts into the # local xmvn repository. BuildRequires: javacc BuildRequires: javacc-maven-plugin BuildRequires: maven-plugin-build-helper %description This package contains a Java 1 to 13 Parser with AST generation and visitor support. The AST records the source code structure, javadoc and comments. It is also possible to change the AST nodes or create new ones to modify the source code. %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains API documentation for %{name}. %prep %autosetup -n %{name}-%{version} sed -i 's/\r//' readme.md # The JUnit BOM import is only used by the (disabled) test modules and is # not needed to build javaparser-core. %pom_remove_dep -r :junit-bom # Release / publishing plugins are not available in the offline build. %pom_remove_plugin :maven-source-plugin %pom_remove_plugin :central-publishing-maven-plugin # Coverage plugin is used by the test modules only. %pom_remove_plugin -r :jacoco-maven-plugin %mvn_alias :javaparser-core com.google.code.javaparser:javaparser # openEuler ships JavaCC 7.0.2, whose Java grammar parser does not accept the # diamond operator (new NodeList<>()) used in an action-code block of java.jj # (ParseException at line 3536). Spell out the type argument so the grammar is # accepted by the older JavaCC. sed -i 's/new NodeList<>()/new NodeList()/' \ javaparser-core/src/main/javacc/java.jj # ph-javacc-maven-plugin is not packaged in openEuler; the codehaus # javacc-maven-plugin provides the same JavaCC grammar generation. sed -i \ -e 's/ph-javacc-maven-plugin/javacc-maven-plugin/' \ -e 's/com.helger.maven/org.codehaus.mojo/' \ javaparser-core/pom.xml # templating-maven-plugin is unavailable; use an equivalent filtered copy # of src/main/java-templates into src/main/java instead. %pom_remove_plugin :templating-maven-plugin javaparser-core %pom_xpath_inject "pom:build" " src/main/java-templates true \${basedir}/src/main/java " javaparser-core # bnd-maven-plugin (OSGi manifest generation) is not needed; provide an # empty MANIFEST.MF so that the maven-jar-plugin manifestFile reference # still resolves. %pom_remove_plugin :bnd-maven-plugin javaparser-core mkdir -p javaparser-core/target/classes/META-INF/ touch javaparser-core/target/classes/META-INF/MANIFEST.MF # Only javaparser-core is packaged; tests, generators and the symbol # solver carry dependencies that are not part of this package. %pom_disable_module javaparser-core-testing %pom_disable_module javaparser-core-testing-bdd %pom_disable_module javaparser-core-generators %pom_disable_module javaparser-core-metamodel-generator %pom_disable_module javaparser-core-serialization %pom_disable_module javaparser-symbol-solver-core %pom_disable_module javaparser-symbol-solver-testing %build export JAVA_HOME=/usr/lib/jvm/java-17-openjdk %mvn_build -f %install %mvn_install %files -f .mfiles %doc readme.md changelog.md %license LICENSE LICENSE.APACHE LICENSE.GPL LICENSE.LGPL %files javadoc -f .mfiles-javadoc %license LICENSE LICENSE.APACHE LICENSE.GPL LICENSE.LGPL %changelog * Mon Nov 02 2026 openEuler Build - 3.28.0-1 - Initial package