Spring Security OAuth Maven build failed - java

I deleted my ~/.m2/repository and did a mvn clean install -P bootstrap on commit #371aad08ac93efa2 (master) cloned from https://github.com/spring-projects/spring-security-oauth. It could not get pass javadoc "phase" and threw up with. I used JDK 1.7.0_65 in Linux and Windows. I could compile the project with my old ~/.m2/repository before.
What am I missing here? Thanks
....
[ERROR] javadoc: warning - Class Autowired not found.
[ERROR] javadoc: warning - Class Autowired not found.
[ERROR]
[ERROR] Command line was:/Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home/jre/../bin/javadoc #options #packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '~/workspace/spring-security-oauth/spring-security-oauth/target/apidocs' dir.
[ERROR] -> [Help 1]

I fixed the problem by adding version tag to 2.9.1 to maven-javadoc-plugin in <project_root>/pom.xml line 187 following #DaveSyer solution i.e.
<groupId>org.apache.maven.plugins</groupId> <!-- added for completeness -->
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version> <!-- fix version instead of getting the latest version, 2.10 -->

Related

getting symbol not found for lombok annotation after upgrading java version from 8 to 17

I've been trying to upgrade the java version[from 8 -> 17] of a spring boot 2.6.4 project.
After setting the java.version property to 17 in pom.xml , I started getting the following issue.
[ERROR] Constructing Javadoc information...
[ERROR] #RequiredArgsConstructor(onConstructor = #__(#Autowired))
[ERROR] ^
[ERROR] symbol: class __
[ERROR] 2 errors
[ERROR]
[ERROR] Command line was: /Users/utkarsh.s/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/javadoc #options #packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/utkarsh.s/Development/apps/sample_project/target/apidocs' dir.
[ERROR]
Please Note :
I'm using IntelliJ 2022.2.3
My lombok version is : 1.18.22 and it is working properly with java8.
In order to upgrade the java version for my project , i have done the following :
-
Installed jdk17 Amazon Correto 17.0.5. [I installed it with intelliJ]
updated maven setting to use JDK for importer as 17.
set the project SDK as 17.
Attaching few snippets of the pom file .
<properties>
<lombok.version>1.18.22</lombok.version>
<java.version>17<java.version>
<properties>
.
.
.
<dependencies>
.
.
.
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
.
.
.
</dependencies>
As per lombok doc https://www.javadoc.io/doc/org.projectlombok/lombok/1.16.18/lombok/RequiredArgsConstructor.html, the syntax has been updated to
#RequiredArgsConstructor(onConstructor_={#AnnotationsGohere})

class file for javax.activation.DataSource not found

There is no compilation error, but the moment I try to build it using maven it throws the following error and fails the build
I'm using Java 11 Open JDK
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project notification-functionapp: Compilation failure
[ERROR] MailSender.java:[112,37] cannot access javax.activation.DataSource
[ERROR] class file for javax.activation.DataSource not found
At 112 line of MailSender.java this following line of code is there
final Multipart multipart = new MimeMultipart("alternative");
javax.activation seems to be not present inherently in Java 11 Open JDK, so if you encounter this error please add the following dependency in you pom.xml or build.gradle
Maven
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency>
Gradle
compile 'com.sun.activation:javax.activation:1.2.0'

Issue with apache poi - Upgrading AEM from 6.5.2 6.5.5

We are planning to upgrade our AEM from 6.5.2 to 6.5.5 through service pack: https://docs.adobe.com/content/help/en/experience-manager-65/release-notes/service-pack/sp-release-n....
While following the instruction, I installed the 6.5.5 package and then updated pom.xml to update uber jar to 6.5.5. I can see those changes in my project.
But when I try to compile and build the project I get below error:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/mukmayu/All_Documents/Project_Official/Manulife_CEA/Code_Workspaces/AEMCodeAll/aem-global/core/src/main/java/ca/manulifeglobal/core/util/AssetAccessUtils.java:[99,7] cannot access org.apache.poi.ooxml.POIXMLDocument
class file for org.apache.poi.ooxml.POIXMLDocument not found
[ERROR] /Users/mukmayu/All_Documents/Project_Official/Manulife_CEA/Code_Workspaces/AEMCodeAll/aem-global/core/src/main/java/ca/manulifeglobal/core/util/AssetAccessUtils.java:[132,19] cannot access org.apache.poi.ooxml.POIXMLDocumentPart
class file for org.apache.poi.ooxml.POIXMLDocumentPart not found
[ERROR] /Users/mukmayu/All_Documents/Project_Official/Manulife_CEA/Code_Workspaces/AEMCodeAll/aem-global/core/src/main/java/ca/manulifeglobal/core/util/AssetAccessUtils.java:[158,15] cannot find symbol
symbol: method write(java.io.ByteArrayOutputStream)
location: variable workbook of type org.apache.poi.xssf.usermodel.XSSFWorkbook
I have added dependency for poi in my project and did maven update..and now I see apache poi 4.0.1...but issue reamains.
Any suggestion...?
Could you please try to include below dependency in your project
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.2</version>
</dependency>

Can't provide version ranges in the maven dependency management import scope

I have a large java project managed using maven.
We are using Maven 3 for management (specifically 3.6.0).
In the project, there is a sub=project with a runtime-v5.pom.xml.
In said pom, there is a version property
<properties>
<platform-v5.version>73.2.05</platform-v5.version>
</properties>
Which is used later in the file
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.company.thing.platform</groupId>
<artifactId>platform-parent</artifactId>
<version>${platform-v5.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.company.release</groupId>
<artifactId>platform-v5</artifactId>
<version>${platform-v5.version}</version>
<type>resolved-pom</type>
</dependency>
</dependencies>
</dependencyManagement>
My goal is to get maven to pull in the most recent version of platform and I don't want to update the version in this file every time. I thought that changing the specific version to a range would allow the project to always pull in the most recent version in accordance with the given range.
When the platform-v5.version is set to a specific existing version, it builds just fine, but when setting the version to a range such as [73.2.05,), I get errors such as
[INFO] Scanning for projects...
[INFO] Downloading from all_global_universal: https://nexus.company/platform-parent/%5B73.2.05,).pom
[ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not find artifact com.company.thing.platform:platform-parent:pom:[73.2.05,) in all_global_universal (https://nexus.company/content/groups/all_global_universal) # com.company:runtime-v5:[unknown-version], path/to/runtime-v5.pom.xml, line XX, column YY
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.company:runtime-v5:1.0.2 (path/to/runtime-v5.pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Could not find artifact com.company.thing.platform:platform-parent:pom:[73.2.05,) in all_global_universal (https://nexus.company/content/groups/all_global_universal) # com.company:runtime-v5:[unknown-version], path/to/runtime-v5.pom.xml, line XX, column YY -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Essentially, I want to know: Why can't you provide version ranges in the maven dependency management import scope?
While version ranges are not exactly deprecated, they are no longer considered a best practise. The modern way would be to run an appropriate update goal before the build so that the version numbers in the pom are the newest ones available.
This is a duplicate of Using maven dependency management import scope with version ranges
This Maven issue was resolved and will be released in Maven 4.0.0: https://issues.apache.org/jira/browse/MNG-4463

Could not find artifact com.sun:tools:jar:0

I'm trying to use checkstyle and findbugs by doing mvn checkstyle:checkstyle but I have this error
This error
[ERROR] Failed to execute goal on project my-project: Could not resolve dependencies for project default:my-project:jar:1.1: Could not find artifact com.sun:tools:jar:0 at specified path C:\Program Files\Java\jdk-11.0.2/../lib/tools.jar -> [Help 1]
I do not have a tools.jar into my JDK (i have jdk-11.0.2).
I'm on it since 2H, please help :/
tools.jar removed from Java 9+
You're on JDK 11. No tools.jar found there.
JEP 220: Modular Run-Time Images removed both tools.jar and rt.jar from the lib folder, as of Java 9.
Removed: rt.jar and tools.jar
The class and resource files previously stored in lib/rt.jar,
lib/tools.jar, lib/dt.jar, and various other internal JAR files are
now stored in a more efficient format in implementation-specific files
in the lib directory. The format of these files is not specified and
is subject to change without notice.
This change is part of adding the Java Platform Module System, a.k.a. Project Jigsaw.
To upgrade Checkstyle, use later versions, such as:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.18</version>
</dependency>
</dependencies>
</plugin>
Notice the inner dependency block.
Consult a Maven repo for versions of Apache Maven Checkstyle Plugin and of Checkstyle.

Categories

Resources