0

I've done a successfull mvn clean install on the project I built and the structure appears correct, all classes included and manifest is under META-INF including class-paths and main-class. Not sure what's not matching up here, but the class contents are valid when I checked contents using javap. Main method is present in the redacted_automatedSupport class and is also public.

Error:

host MINGW64 ~/Desktop/Projects/redacted_Automated_Support/target (master)
$ java -jar redacted_automatedSupport-1.0.jar
Error: Could not find or load main class support.redacted_automatedSupport

host MINGW64 ~/Desktop/Projects/redacted_Automated_Support/target (master)
$ java -cp redacted_automatedSupport-1.0.jar support.redacted_automatedSupport
Error: Could not find or load main class support.redacted_automatedSupport

host MINGW64 ~/Desktop/Projects/redacted_Automated_Support/target (master)
$

Manifest contents:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: bennet.vella
Class-Path: aws-java-sdk-s3-1.11.696.jar aws-java-sdk-kms-1.11.696.jar
  aws-java-sdk-core-1.11.696.jar commons-logging-1.1.3.jar httpclient-
 4.5.9.jar httpcore-4.4.11.jar commons-codec-1.11.jar ion-java-1.0.2.j
 ar jackson-databind-2.6.7.3.jar jackson-annotations-2.6.0.jar jackson
 -core-2.6.7.jar jackson-dataformat-cbor-2.6.7.jar joda-time-2.8.1.jar
  jmespath-java-1.11.696.jar groovy-3.0.1.jar groovy-json-3.0.1.jar gr
 oovy-dateutil-3.0.1.jar
Created-By: Apache Maven 3.6.3
Build-Jdk: 1.8.0_231
Main-Class: support.redacted_automatedSupport

Jar Archive Contents (renamed to zip to browse):

Jar archive contents

Support Jar Contents (removed some unecessary data, all names match): Support Jar Contents

Luponius
  • 89
  • 1
  • 8
  • 1
    Can the groovy-jar be found (not clear from the screenshots where is supposed to be (looks not like a shadow jar or or springboot fat jar)). Is main static? – cfrick Mar 25 '20 at 15:26
  • Now that's an interesting point, since I've worked with java before but never jarred groovy code. I'm assuming a single jar would be built and it would contain within all the class files relevant to groovy. – Luponius Mar 27 '20 at 07:49
  • As I said, it's hard to tell. Can you provide a minimal failing example? – cfrick Mar 27 '20 at 09:32
  • Can't really share direct code unfortunately, just the idea. I understand how this would make it very hard, or impossible to diagnose the issue - Thanks for trying. As for minimal failing example, I honestly wouldn't know where the cutoff point would be. Maybe any external library used would cause it to fail. I should also mention that yes, main is static. In fact I've gotten the code to begin running previously but it immediately fails on groovy date utils even though that dependency is present. – Luponius Mar 28 '20 at 08:27
  • I think @cfrick is right. I suggested reading http://maven.apache.org/plugins/maven-shade-plugin/. – Keegan Jun 27 '20 at 21:30

1 Answers1

0

It is not a complete answer, since it doesn't target the Maven issue I was having, but I did solve the IntelliJ problem I had with the wrong manifest file - and that's because I was creating the manifest in src/main/java when it should have been src/main/resources. This should hopefully alleviate some users' problems.

I have not however resolved how to properly build and include all relevant dependent jars using Maven - intelliJ does this successfully.

Luponius
  • 89
  • 1
  • 8