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

Issue #12124 fix jsp scratchdir location for ee9. #12129

Merged
merged 7 commits into from
Aug 5, 2024

Conversation

janbartel
Copy link
Contributor

Closes #12124

After #12044, the jsp scrachdir is showing up in jetty.base instead of under the webapp's tmp dir.
Also, the name of the webapp's tmp dir (if created by jetty) is missing the name of the war.

Also ensure the name of war appears in the name of the tmp dir for ee9
webapps.
gregw
gregw previously approved these changes Aug 2, 2024
@@ -2852,4 +2864,9 @@ public boolean handle(org.eclipse.jetty.server.Request coreRequest, Response res
}
}
}

public Resource getResourceAsBaseName()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about calling this:

Suggested change
public Resource getResourceAsBaseName()
public Resource getNestedResourceForeTempDirName()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@joakime
Copy link
Contributor

joakime commented Aug 2, 2024

Still some test failures.

@joakime joakime closed this Aug 2, 2024
@joakime joakime reopened this Aug 2, 2024
@joakime
Copy link
Contributor

joakime commented Aug 2, 2024

wrong danged button push!

FS.ensureDirExists(myTempDir);

// Create war on the fly
Path testWebappDir = MavenTestingUtils.getProjectDirPath("src/test/webapp");
Copy link
Member

@olamy olamy Aug 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may not work with generated ee8 as resources are in target/test-classes.
But depends if the test only need the web.xml or the other resources as the web.xml will not be in this directory)

Suggested change
Path testWebappDir = MavenTestingUtils.getProjectDirPath("src/test/webapp");
Path testWebappDir = MavenTestingUtils.getTargetPath("test-classes/webapp");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new MavenPaths object has several .find* methods that will work as intended on ee8/ee9.
Can we use one of those?

public void testFreshTempDir(WorkDir workDir) throws Exception
{
// Create war on the fly
Path testWebappDir = MavenTestingUtils.getProjectDirPath("src/test/webapp");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Suggested change
Path testWebappDir = MavenTestingUtils.getProjectDirPath("src/test/webapp");
Path testWebappDir = MavenTestingUtils.getTargetPath("test-classes/webapp");

public void testSameTempDir(WorkDir workDir) throws Exception
{
// Create war on the fly
Path testWebappDir = MavenTestingUtils.getProjectDirPath("src/test/webapp");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Suggested change
Path testWebappDir = MavenTestingUtils.getProjectDirPath("src/test/webapp");
Path testWebappDir = MavenTestingUtils.getTargetPath("test-classes/webapp");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, the tests appear to be working on ee8?

@janbartel janbartel requested a review from gregw August 5, 2024 03:04
@janbartel janbartel merged commit 661546e into jetty-12.0.x Aug 5, 2024
10 checks passed
@janbartel janbartel deleted the jetty-12.0.x-12124-jsp-tmp-dir branch August 5, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

JSP temp directory regression, possibly due to fix for #12044
4 participants