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

Keep the custom Class-Path in the manifest file #25698

Closed
wants to merge 1 commit into from

Conversation

h2cone
Copy link

@h2cone h2cone commented May 20, 2022

Currently we can specify custom manifest entries, but we cannot keep the custom Class-Path because generating the manifest would overwrite this existing entry.

By adding additional JAR files and directories to the class path, we can not only avoid specifying a long -classpath flag, but also load resources via relative paths.

@h2cone h2cone changed the title Override Class-Path but keep the existing class path Keep the custom Class-Path in the manifest file May 23, 2022
@h2cone
Copy link
Author

h2cone commented May 23, 2022

PTAL @geoand

@geoand
Copy link
Contributor

geoand commented May 23, 2022

I don't think this is going to work for fast-jar to be honest...

@h2cone
Copy link
Author

h2cone commented May 23, 2022

I don't think this is going to work for fast-jar to be honest...

Thanks, could you please explain it in detail?

In my case, the app.jar and resources are separated into the same directory because they are often changed independently:

.
├── app.jar
└── resources
    ├── application.properties
    ├── init
    │   └── my.json
    ├── static
    └── templates

I need to load a resource by its name, for example using the method getResourceAsStream, so I try to customize the class path:

quarkus.package.manifest.attributes."Class-Path"=resources/

Use ./mvnw package -Dquarkus.package.type=uber-jar to output uber-jar, the following method returns null after startup:

Thread.currentThread().getContextClassLoader().getResourceAsStream("init/my.json");

Why must the Class-Path of uber-jar be overwritten with blank when generating manifest?

@geoand
Copy link
Contributor

geoand commented May 23, 2022

Why must the Class-Path of uber-jar be overwritten with blank when generating manifest?

My comment was about fast-jar, not uber-jar :)

@quarkus-bot
Copy link

quarkus-bot bot commented May 23, 2022

Failing Jobs - Building b4d132e

Status Name Step Failures Logs Raw logs
Devtools Tests - JDK 11 Build Failures Logs Raw logs
Devtools Tests - JDK 17 Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Devtools Tests - JDK 11 #

- Failing: integration-tests/devtools 

📦 integration-tests/devtools

io.quarkus.platform.catalog.RegistrySnapshotCatalogCompatibilityTest.testRegistrySnapshotPlatformCatalog line 30 - More details - Source on GitHub

java.lang.IllegalStateException: Failed to locate the dev tools config file (.quarkus/config.yaml)
	at io.quarkus.devtools.testing.registry.client.TestRegistryClient.<init>(TestRegistryClient.java:33)
	at io.quarkus.devtools.testing.registry.client.TestRegistryClientFactory.buildRegistryClient(TestRegistryClientFactory.java:32)

⚙️ Devtools Tests - JDK 17 #

- Failing: integration-tests/devtools 

📦 integration-tests/devtools

io.quarkus.platform.catalog.RegistrySnapshotCatalogCompatibilityTest.testRegistrySnapshotPlatformCatalog line 30 - More details - Source on GitHub

java.lang.IllegalStateException: Failed to locate the dev tools config file (.quarkus/config.yaml)
	at io.quarkus.devtools.testing.registry.client.TestRegistryClient.<init>(TestRegistryClient.java:33)
	at io.quarkus.devtools.testing.registry.client.TestRegistryClientFactory.buildRegistryClient(TestRegistryClientFactory.java:32)

@gsmet
Copy link
Member

gsmet commented Jun 21, 2022

I'm not sure this really makes sense, especially with the closed world assumption we have in Quarkus. We want jars to be detectable by Quarkus and not pushed to it via the classpath.

What is your requirement exactly and why do you want to do that, rather than say add a new dependency to your build file?

@gsmet
Copy link
Member

gsmet commented Feb 2, 2023

Closing for lack of feedback.

@gsmet gsmet closed this Feb 2, 2023
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants