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

build bug:mybatis 'any' jar file has ognl package , but mybatis 'any' source no ognl or javassist package. Can't look source in Intellij. #3045

Closed
startjava opened this issue Dec 25, 2023 · 6 comments · Fixed by #3047
Assignees
Milestone

Comments

@startjava
Copy link

mybatis 3.5.14 jar file has ognl package , but mybatis 3.5.14 source no ognl packge .

@hazendaz
Copy link
Member

I looked back a long time, we have never best I can tell supplied that source the source jar. Is this causing you an issue in Intellij? Assume that is what you mean by idea. Its shaded content.

@startjava
Copy link
Author

image
@hazendaz

jar has ognl directory, but source.jar no has ognl directory .

@wuwen5
Copy link
Contributor

wuwen5 commented Dec 26, 2023

This is not a problem, it is handled by the Maven-shade-plugin, the source code package of MyBatis does not originally include them.

@wuwen5
Copy link
Contributor

wuwen5 commented Dec 26, 2023

Perhaps we need to add this in the maven-shade-plugin ?
<shadeSourcesContent>true</shadeSourcesContent>

@hazendaz
Copy link
Member

Hi, correct, we have never done this before. I was able to get it to work through. It was more than just the shade sources. You have to let the shake plugin create the sources jar but then we have to force the sources jar to run first. I'll get a proper PR up shortly as I need to cleanup what I did in getting it to work fully.

@hazendaz hazendaz self-assigned this Dec 26, 2023
@hazendaz hazendaz added this to the 3.5.16 milestone Dec 26, 2023
@hazendaz hazendaz changed the title build bug:mybatis 3.5.14 jar file has ognl package , but mybatis 3.5.14 source no ognl packge . can't look source in idea. build bug:mybatis 'any' jar file has ognl package , but mybatis 'any' source no ognl or javassist package. Can't look source in Intellij. Dec 26, 2023
@hazendaz
Copy link
Member

hazendaz commented Dec 26, 2023

@wuwen5 I first was going to close this as its an edge case at best. I was already looking at the one flag you saw but did nothing on its own. It required the sources created from shading but that then only includes ognl and javassist so it took a bit more to pull off. Personally, I'm so highly against shading these artifacts but rest of team does not agree. I think one day I'll get my way but that won't be until mybatis 4 and years probably. I digress.

At any rate, I don't think maven intended to have people shade single jars like we have this way. I think they meant for a separate jar such as mybatis-shaded to have been created to which the flags they created would have worked correctly. But then some users will complain the need to use too many jars to which I ask (what no maven, no gradle, no ivy, not etc).

Now maybe that is something I can get team to think of with maven 3.6.0. The concern has always been around those modules being messed up in the past and tickets I believe coming in when people could not update. But honestly we have Renovate, it tell us the updates, Github Actions will either work or fail. And we are usually fast to correct and move on, just slower on release. But nothing stops us from breaking these legacy behaviors.

For now though, I think PR #3047 will in fact fix the consideration never mind my above ranting ;) And FWIW, both ognl recently required a number of changes to again work with us and javassist was broken for couple weeks. But either way they got fixed quickly enough (faster than we run anyways).

hazendaz added a commit that referenced this issue Dec 26, 2023
[pom] Make sure source package picks up our shaded artifacts to help users in IDEs - fixes #3045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants