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
Switch to Non-Maven Jar plugin to vendor jars #206
Conversation
- This enables anyone to checkout and build the project without having to mess around with installing jar files
Here's the details on the plugin I wrote a while back: https://github.com/stephenc/non-maven-jar-maven-plugin |
Thanks @stephenc !
And then, I added the local repository in my <repository>
<id>lib</id>
<url>file://${project.basedir}/lib</url>
</repository> It's a bit hacky because you have to commit a local maven repository but it's working... 😬
It's definitely an improvement, and the changes are minimal so 👍 |
is also bad because most corporate users will have |
<artifactId>ditaa</artifactId> | ||
<version>${ditaa.version}</version> | ||
<version>${project.version}</version> |
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.
Is it possible to keep the version of the jar? If not I guess that we can safely remove the reference in the <properties>
right?
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.
Not if you want to use the Maven release tooling...
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.
I'm pretty sure there's a good reason but I'm not sure I understand why... we are using a "released" version no? Sorry, I'm sure I'm not using the correct terminology but I would expect this dependency to be resolved as a "standard" dependency.
But I guess the thirdparty/ditaa/pom.xml
is not really the pom of the dependency but the pom of the project that contains a jar. So we cannot define <version>1.3.13</version>
in thirdparty/ditaa/pom.xml
and use it in here?
Anyway, I think it's fine, I'm mainly asking to learn 🤓
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.
Once you get the release plugin automating the version number bumps you’ll need all the poms to align their version number.
If you’re not using a release plugin and not using -SNAPSHOT
versions on master then you could have different versions
Anything blocking merging this? |
@stephenc No it's looking good but I want to checkout the branch locally and play with it before merging 😄 |
For some IDEs you may need to use |
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.
Thanks again, it's working just fine 👌
@stephenc I spoke too soon, it's not working on Intellij IDEA... even if I do Edit: Manually adding the dependency on "Project Structure..." works but not ideal. The dependencies look fine but it looks like the non-maven jars are ignored by Intellij. |
Strange. Works for me in IntelliJ. I’ll wipe my cache and try again |
Very strange indeed... I'm using:
I will try with the latest version... |
@stephenc could you please confirm that it's working fine after the cache has been wiped? If so, could you please copy/paste your Intellij version? Thanks! |
@Mogztter I am sorry, IntelliJ seems to have taken a step back in how they parse Maven project models. I may need to rework some hacks into the non-maven jar. For now just revert this commit and I'll re-submit the PR once I find some way to get IDEA working again... The TL;DR https://youtrack.jetbrains.com/issue/IDEA-175538 is probably the issue here |
When I reported https://youtrack.jetbrains.com/issue/IDEA-175538 everything worked in IDEA as long as you didn't add |
A workaround is to run |
Oooooh.... we could have a profile that is active unless maven is being parsed by intellij... that profile could add the 3rd party jar files |
Something like
Though IDEA seems not to be correctly parsing profile activation either and is incorrectly enabling that profile... But at least putting third party in a profile allows you to deactivate the profile and get IDEA working again (after |
Ok IDEA's pom parsing no longer exposes |
Damn!
That could work!
Ok. |
NOTE: I know when I wrote the non-maven jar maven plugin I included a warning about "use of the plugin acknowledging bad citizen, etc" but that is more reflecting that we (The Apache Maven PMC) want to nudge people towards publishing on Central... which is also why I published the plugin from my personal account rather than releasing it from the Apache Maven project itself. However, compared to what you were doing with the
lib
folders, this is - as a member of the Apache Maven PMC - an improvement.