Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executable jar problem #2565

Closed
iluwatar opened this issue Aug 20, 2023 · 18 comments · Fixed by #3090
Closed

Executable jar problem #2565

iluwatar opened this issue Aug 20, 2023 · 18 comments · Fixed by #3090

Comments

@iluwatar
Copy link
Owner

The project includes Maven Assembly plugin to produce executable jars out of all the submodules (individual patterns). However, there currently seems to be a problem with the intended behaviour.

Steps to reproduce:

  1. At the project root build everything, i.e. mvn clean package -DskipTests=true
  2. Execute one of the produced jars, e.g. java -jar spatial-partition/target/spatial-partition-1.26.0-SNAPSHOT.jar

Expected behaviour

  • The spatial partition jar is executed and the pattern example runs without problems

Actual behavior

  • An error message no main manifest attribute, in spatial-partition/target/spatial-partition-1.26.0-SNAPSHOT.jar is printed
@satyajitbhatt
Copy link

Hello @iluwatar Can you give me chance to solve above issue ? If yes then I'm willing to contribute over here and want to help you to solve executable jar problem.

Thank you in advance

@Sujoydas001
Copy link

Can I have a look here ?

@iluwatar
Copy link
Owner Author

@satyajitbhatt are you working on it?

@satyajitbhatt
Copy link

satyajitbhatt commented Sep 24, 2023 via email

@Navneetsinghnegi
Copy link

@iluwatar I want to go through the issue and work upon it

@BrijeshPatra
Copy link

Hi @iluwatar here we have 2 approaches to solve this bug
a) add the name of main class to the jar file
b) create the jar file as an executable jar

@BrijeshPatra
Copy link

I am trying hard to contribute but getting an error Unable to access jarfile spatial-partition/target/spatial-partition-1.26.0-SNAPSHOT.jar. It would be helpful if you review it once and suggest me something better @iluwatar

@BrijeshPatra
Copy link

Bug

@iluwatar
Copy link
Owner Author

iluwatar commented Oct 1, 2023

Assigned to @Navneetsinghnegi

@Aniket-kumar404
Copy link

I would Like to work on this issue.

Copy link

stale bot commented Nov 30, 2023

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale issues and pull requests that have not had recent interaction label Nov 30, 2023
@iluwatar iluwatar moved this from In Progress to Todo in Java Design Patterns project Mar 24, 2024
gsush added a commit to gsush/java-design-patterns that referenced this issue May 26, 2024
@iluwatar iluwatar added info: good first issue and removed status: stale issues and pull requests that have not had recent interaction labels Jun 1, 2024
@emcconnell27
Copy link

Hi @iluwatar, could please have a go at solving this issue?

@iluwatar iluwatar moved this from Todo to In Progress in Java Design Patterns project Jul 7, 2024
Copy link

stale bot commented Sep 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale issues and pull requests that have not had recent interaction label Sep 6, 2024
@iluwatar iluwatar moved this from In Progress to Todo in Java Design Patterns project Oct 6, 2024
@apophizzz
Copy link
Contributor

apophizzz commented Oct 7, 2024

Hi @iluwatar, I think I actually found a tiny configuration fix for the assembly plugin that produces a single fat JAR - e.g. proxy-1.26.0-SNAPSHOT.jar - which executes successfully:

$ cd proxy/
$ mvn clean package -DskipTests=true 
$ ls -al target/
-rw-r--r--   1 patrick  staff  958950 Oct  8 00:12 proxy-1.26.0-SNAPSHOT.jar
...
$ java -jar target/proxy-1.26.0-SNAPSHOT.jar
00:12:39.160 [main] INFO com.iluwatar.proxy.IvoryTower -- Red wizard enters the tower.
00:12:39.162 [main] INFO com.iluwatar.proxy.IvoryTower -- White wizard enters the tower.
00:12:39.163 [main] INFO com.iluwatar.proxy.IvoryTower -- Black wizard enters the tower.
00:12:39.163 [main] INFO com.iluwatar.proxy.WizardTowerProxy -- Green wizard is not allowed to enter!
00:12:39.163 [main] INFO com.iluwatar.proxy.WizardTowerProxy -- Brown wizard is not allowed to enter!

Feel free to assign the issue to me and I'll submit a PR. Thx!

@ananyadhagat
Copy link

Hey I am working on this issue @iluwatar

@stale stale bot removed the status: stale issues and pull requests that have not had recent interaction label Oct 17, 2024
@Soumayadip937
Copy link

@iluwatar I am new to open source contribution, could you please help me to get started on this issue?

@yuvraj-kumar-dev
Copy link

Hi @iluwatar,
I'd love to tackle the Maven Assembly plugin issue. Could you please assign this task to me?
Thank you!

@abhi8f
Copy link

abhi8f commented Oct 23, 2024

Hi @iluwatar
image
there is two jar files spatial-partition-1.26.0-SNAPSHOT.jar and spatial-partition.jar
is 2 jar files intended behavior ? if no i have soultion

image

if only one jar file is required, putting filename in maven assembly plugin works
i can do this and raise a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.