-
Notifications
You must be signed in to change notification settings - Fork 50
fix(QTDI-2004): check if running into jobserver #1105
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -111,6 +111,7 @@ public ContainerManager(final DependenciesResolutionConfiguration dependenciesRe | |||||||||||||
this.logInfoLevelMapping = logInfoLevelMapping; | ||||||||||||||
this.containerInitializer = containerInitializer; | ||||||||||||||
this.resolver = dependenciesResolutionConfiguration.getResolver(); | ||||||||||||||
final boolean hasClasspathJar = "classpath.jar".equals(System.getProperty("java.class.path", "")); | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "classpath.jar" is valid for remote job server run way and other cases? in my memory, is only for local run in studio which as test mode for customer. Maybe i am wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://qlik-dev.atlassian.net/browse/SUPPORT-6134 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I'm wrong but it seems that the local run of a studio job exported to zip, uses a batch script to launch job's execution. This script sets the m2 system property used by component manager to the
Thus not the specific case related. In fact, this fix apply only when a The SUPPORT-6134 issue mentions "Cloud Export" and specifies in the description Talend > Import/Export > Add classpath jar in exported jobs (not compatible with JobServer). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added case when
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The hardcoded string Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||
|
||||||||||||||
Path rootRepo = ofNullable(dependenciesResolutionConfiguration.getRootRepositoryLocation()) | ||||||||||||||
.filter(Files::exists) | ||||||||||||||
|
@@ -119,7 +120,8 @@ public ContainerManager(final DependenciesResolutionConfiguration dependenciesRe | |||||||||||||
if (PathFactory.get(System.getProperty("user.home")).resolve(".m2/repository").equals(rootRepo)) { | ||||||||||||||
final URL nested = classLoaderConfiguration.getParent().getResource("MAVEN-INF/repository"); | ||||||||||||||
if (nested != null) { | ||||||||||||||
rootRepo = PathFactory.get(nested.getFile().replace("file:", "")); | ||||||||||||||
info("Nested maven repository: " + nested.getFile()); | ||||||||||||||
rootRepo = PathFactory.get(nested.getFile().replaceAll("^(file|nested):", "")); | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The regex pattern
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
this.rootRepositoryLocation = rootRepo; | ||||||||||||||
|
@@ -136,7 +138,10 @@ public ContainerManager(final DependenciesResolutionConfiguration dependenciesRe | |||||||||||||
if (classLoaderConfiguration.isSupportsResourceDependencies()) { | ||||||||||||||
try (final InputStream mappingStream = | ||||||||||||||
classLoaderConfiguration.getParent().getResourceAsStream(nestedPluginMappingResource)) { | ||||||||||||||
undx marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
if (mappingStream != null) { | ||||||||||||||
// When a `classpath.jar` is provided to jvm (like JobServer) using plugin path based on maven | ||||||||||||||
// repository structure is not functional. Therefore, we skip loading the nested plugin mapping when | ||||||||||||||
// hasClasspathJar is true. Autodiscovery will find plugins later. | ||||||||||||||
if (mappingStream != null && !hasClasspathJar) { | ||||||||||||||
final Properties properties = new Properties() { | ||||||||||||||
|
||||||||||||||
{ | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems here only catch the exception and ignore it, is enough?