Re: Can the jar plugin respect .gitignore?
On 10.11.23 19:42, Joseph Kessselman wrote: (Or, equivalently be told to take exclude list from a file in .gitignore syntax and then be told .gitignore was that file.) If not, I'd consider that worth adding. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org Please make an example or post a link to the appropriate project... because jar plugin and .gitignore does not make sense... also for maven-assembly-plugin it sounds a bit weird to be honest? ... What exactly are you trying to achieve? Kind regards Karl Heinz Marbaise - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
Hi Joseph, On Sat, 11 Nov 2023 at 17:27, Joseph Kesselman wrote: > > ... Right. I was thinking specifically about source assembly, where a good > initial approximation is to include the same files checked into git. > Obviously that's wrong for binary assembly, but having the option of "import > ignore list into source excludes" would help keep the two in synch. And the > basic selection pattern syntax seems close to the same. At Logging Services we are currently using a script to include all files in the Git repository (and only the files in the repository): https://github.com/apache/logging-parent/blob/c6f639f6ecfcf1a74b1c7596f7d8c20dd515d8b8/pom.xml#L1166 In time we plan to integrate this with the Maven Assembly and Scm plugin. Piotr - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
I welcome feedback on where I might have departed from Maven conventions and defaults, or otherwise missed a bet. I actually don't think I'm far off -- maybe not the most elegant solutions possible, but basically using Maven as designed to be used. But I'd sorta appreciate it if folks were throwing net-rocks at what I actually did rather than what you fear I might have done. Directed feedback is more useful. -- /_ Joe Kesselman (he/him/his) -/ _) My Alexa skill for New Music/New Sounds fans: / https://www.amazon.com/dp/B09WJ3H657/ () Plaintext Ribbon Campaign /\ Stamp out HTML mail! From: Alexander Kriegisch Sent: Saturday, November 11, 2023 7:31:25 PM To: users@maven.apache.org Subject: Re: Can the jar plugin respect .gitignore? Let me also chime in, telling an "old war story" from my early days in AspectJ: It used to be a very complex and convoluted Ant multi-module monster. I never dared to even try and understand the build or contribute to the project. Then one day, Andy Clement converted the project to a Maven project, and suddenly I began to understand the structure better. I started contributing to the project infrastructure, weeding out the remaining relics of a replicated, scripted build taken over from Ant, and use *convention over configuration*. Now, you can just clone the repository, import the Maven project into Eclipse or IDEA and build it. We also have some source and binary assemblies, and I never thought about using .gitignore as a source for excludes, because -- as was said before, you usually exclude target, the very folder of most interest for binary assemblies, and -- whatever is ignored in my .gitignore and resides outside the target folder, is usually also to be ignored in source assemblies. If your case is any different, chances are that your directory structure is suboptimal and non-standard. IMO, the one-time effort of developers getting to know the new directory layout is well invested, because sticking to Maven conventions pays off in so many ways, not just because IDE import is now easier and users can contribute patches or features more easily due to painless on-boarding. -- Alexander Kriegisch https://scrum-master.de Greg Chabala schrieb am 12.11.2023 06:32 (GMT +07:00): > I hesitate to bring it up, but this seems as good a time as any. > You've mentioned several times your intent to massage the Xalan Maven > build to produce artifacts at parity with the existing Ant build, and > not just the contents of artifacts but also where they end up in the > directory structure, for the convenience of those who are used to the > Ant build. > > I foresee that if you are truly successful in this goal, you will have > thoroughly reimplemented a procedural Ant build, and created a very > weird Maven build, to the point where you may exclaim 'why did I even > start this? It took so much work to get Maven to do what I was doing > easily in Ant!', and Maven users will be confused about why there's > nothing they expected in the target directory after running compile. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
I am using a Maven build structure. Or my best attempt at it as a newcomer to Maven. I've been delaying cutover specifically because I didn't want to pull the trigger without a sanity check. Gary has said he'll try to look at what I've done soon. If anyone else has cycles, I'd welcome review of what I've done, questions about why I made those decisions, and suggestions for better ways to achieve the goals. Again: This is intended to be a Maven-native build, with some postprocessing so folks who were used to the Ant build and have assumptions based on it can also find the jars, tars, and zips they expect in the place they're used to seeing them. The build itself is working; I'm essentially just dealing with that final cosmetic stage, and trying to do so in a reasonably drclarative Maven-native way rather than resorting to a shell script. -- /_ Joe Kesselman (he/him/his) -/ _) My Alexa skill for New Music/New Sounds fans: / https://www.amazon.com/dp/B09WJ3H657/ () Plaintext Ribbon Campaign /\ Stamp out HTML mail! From: Bernd Eckenfels Sent: Saturday, November 11, 2023 6:43:15 PM To: users@maven.apache.org Subject: Re: Can the jar plugin respect .gitignore? Hello, Joseph Kesselman wrote on 11. Nov 2023 17:27 (GMT +01:00): > ... Right. I was thinking specifically about source assembly, where a good > initial approximation is to include the same files checked into git. If you stick to the maven way, this is pretty trivial: you only need to exclude the target/ directory - or only include the src/ directory which is common for -src artifacts. I fully agree, don’t try to mold maven projects in a custom structure… it can be done to some extend, but it will not make you happy. Gruß Bernd — https://bernd.eckenfels.net - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
Don't worry. I'm not trying to reproduce the Ant build logic. I'm trying to be as Maven& idiomatic as I can in the actual build. But if possible I want to produce, from that, a directory which contains somethIng close to what the Ant build would have delivered. Both because I haven't had time to rework the tests yet and they have assumptions about what they access to execute the build, and because showing that I can get the same final jar or zip file out of the build is strong evidence that the port is correct and complete. I've been using diffs between the Maven-produced jarfiles and the Ant ones as sanity checks, and that has flushed out some errors in the build along the way. But that's the only level at which I'm making it look like Ant, and that only as a final postprocessing layer. Remember, I'm an XSLT developer. Declarative programming is nothing new to me. I'm just still learning how to write the declarations so Maven will do what's necessary. If anything, I was hoping Maven's dependency driven defaults were just a bit stronger than they are... but I'm learning how to talk to it. We're going in the same direction. I'm just learning how Maven wants to get there. -- /_ Joe Kesselman (he/him/his) -/ _) My Alexa skill for New Music/New Sounds fans: / https://www.amazon.com/dp/B09WJ3H657/ () Plaintext Ribbon Campaign /\ Stamp out HTML mail! From: Greg Chabala Sent: Saturday, November 11, 2023 6:32:13 PM To: Maven Users List Subject: Re: Can the jar plugin respect .gitignore? I hesitate to bring it up, but this seems as good a time as any. You've mentioned several times your intent to massage the Xalan Maven build to produce artifacts at parity with the existing Ant build, and not just the contents of artifacts but also where they end up in the directory structure, for the convenience of those who are used to the Ant build. I foresee that if you are truly successful in this goal, you will have thoroughly reimplemented a procedural Ant build, and created a very weird Maven build, to the point where you may exclaim 'why did I even start this? It took so much work to get Maven to do what I was doing easily in Ant!', and Maven users will be confused about why there's nothing they expected in the target directory after running compile. There's something to be said for embracing the Maven Way [1], and if you want to keep both builds in sync for a time, perhaps the effort would be better spent in updating the Ant build to put things in the places Maven puts them by default. [1]: https://maven.apache.org/background/philosophy-of-maven.html
Re: Can the jar plugin respect .gitignore?
Let me also chime in, telling an "old war story" from my early days in AspectJ: It used to be a very complex and convoluted Ant multi-module monster. I never dared to even try and understand the build or contribute to the project. Then one day, Andy Clement converted the project to a Maven project, and suddenly I began to understand the structure better. I started contributing to the project infrastructure, weeding out the remaining relics of a replicated, scripted build taken over from Ant, and use *convention over configuration*. Now, you can just clone the repository, import the Maven project into Eclipse or IDEA and build it. We also have some source and binary assemblies, and I never thought about using .gitignore as a source for excludes, because -- as was said before, you usually exclude target, the very folder of most interest for binary assemblies, and -- whatever is ignored in my .gitignore and resides outside the target folder, is usually also to be ignored in source assemblies. If your case is any different, chances are that your directory structure is suboptimal and non-standard. IMO, the one-time effort of developers getting to know the new directory layout is well invested, because sticking to Maven conventions pays off in so many ways, not just because IDE import is now easier and users can contribute patches or features more easily due to painless on-boarding. -- Alexander Kriegisch https://scrum-master.de Greg Chabala schrieb am 12.11.2023 06:32 (GMT +07:00): > I hesitate to bring it up, but this seems as good a time as any. > You've mentioned several times your intent to massage the Xalan Maven > build to produce artifacts at parity with the existing Ant build, and > not just the contents of artifacts but also where they end up in the > directory structure, for the convenience of those who are used to the > Ant build. > > I foresee that if you are truly successful in this goal, you will have > thoroughly reimplemented a procedural Ant build, and created a very > weird Maven build, to the point where you may exclaim 'why did I even > start this? It took so much work to get Maven to do what I was doing > easily in Ant!', and Maven users will be confused about why there's > nothing they expected in the target directory after running compile. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
Hello, Joseph Kesselman wrote on 11. Nov 2023 17:27 (GMT +01:00): > ... Right. I was thinking specifically about source assembly, where a good > initial approximation is to include the same files checked into git. If you stick to the maven way, this is pretty trivial: you only need to exclude the target/ directory - or only include the src/ directory which is common for -src artifacts. I fully agree, don’t try to mold maven projects in a custom structure… it can be done to some extend, but it will not make you happy. Gruß Bernd — https://bernd.eckenfels.net - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
I hesitate to bring it up, but this seems as good a time as any. You've mentioned several times your intent to massage the Xalan Maven build to produce artifacts at parity with the existing Ant build, and not just the contents of artifacts but also where they end up in the directory structure, for the convenience of those who are used to the Ant build. I foresee that if you are truly successful in this goal, you will have thoroughly reimplemented a procedural Ant build, and created a very weird Maven build, to the point where you may exclaim 'why did I even start this? It took so much work to get Maven to do what I was doing easily in Ant!', and Maven users will be confused about why there's nothing they expected in the target directory after running compile. There's something to be said for embracing the Maven Way [1], and if you want to keep both builds in sync for a time, perhaps the effort would be better spent in updating the Ant build to put things in the places Maven puts them by default. [1]: https://maven.apache.org/background/philosophy-of-maven.html
Re: Can the jar plugin respect .gitignore?
The "binary" assembly I'm trying to reproduce is the one our And project generated -- the artifact jarfile, plus source and input for the samples, plus the documentation directory -- basically, everything an end-user might want locally. I'm getting close to having that working. Output directory in some places refers to directory within the archive. For example, I have it copying my Maven target/site/ directory to releaseName/docs/ inside the tar.gz and zip files, to confirm to past patterns. It isn't clear whether I should move the src assembly build down into this late processing module. Conceptually it belongs next to the bin assembly, but syntactically I think it's simpler in the parent pom. Unless I'm missing something. Again. Biggest remaining challenge: Again for convenience of folks who were used to the Ant build, I'd like to move/copy both bin and src assemblies to my Ant-emulation build/ directory. And again, if I try to do this with a separate copying operation it looks like I need another layer of dependency to ensure the bin assembly is generated before I copy it. Doable but not pretty. Having the assemblies write directly into build/ would be another solution if available. Random brainstorm, may be all wet: Maven might want to consider allowing users to specify priority. Phase is a good default/basic sequencing tool, but as the need to resort to dependencies shows, not quite complete by itself. If I could assign what amount to sub-phases by saying "this is higher or lower priority than anything else which runs in that phase", that might let me resolve cases where the phase alone is not enough to ensure desired sequence of operations... such as not running assembly until after other packaging is complete. -- /_ Joe Kesselman (he/him/his) -/ _) My Alexa skill for New Music/New Sounds fans: / https://www.amazon.com/dp/B09WJ3H657/ () Plaintext Ribbon Campaign /\ Stamp out HTML mail! From: Greg Chabala Sent: Saturday, November 11, 2023 12:38:05 PM To: Maven Users List Subject: Re: Can the jar plugin respect .gitignore? I have no first hand experience using it, and only know of its existence as it's mentioned at the bottom the Reproducible Builds docs: https://reproducible-builds.org/docs/jvm/ Notably the maven-assembly-plugin documentation mentions a predefined 'project' descriptor which may also do just what you want(for buildable sources): https://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#project You should be able to configure outputDirectory for either to place the assembly where you like: https://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#outputDirectory Didn't see a binary equivalent, but perhaps that would just be your normal build artifact?
Re: Can the jar plugin respect .gitignore?
I have no first hand experience using it, and only know of its existence as it's mentioned at the bottom the Reproducible Builds docs: https://reproducible-builds.org/docs/jvm/ Notably the maven-assembly-plugin documentation mentions a predefined 'project' descriptor which may also do just what you want(for buildable sources): https://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#project You should be able to configure outputDirectory for either to place the assembly where you like: https://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#outputDirectory Didn't see a binary equivalent, but perhaps that would just be your normal build artifact?
Re: Can the jar plugin respect .gitignore?
On 11/11/2023 11:44 AM, Greg Chabala wrote: Use the sourceReleaseAssemblyDescriptor of maven-assembly-plugin: https://maven.apache.org/apache-resource-bundles/source-release/ Thanks; hadn't seen that one. Definitely a fan of not reinventing wheels. Can that be configured to write the archives to a specific directory? I've been trying to simulate the Ant build/ directory, for backward compatibility... I can copy the archives there after they've been built, of course, if I can get the phase sequencing right. Is there an equivalent standard configuration for Apache binary release? - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
> > I was thinking specifically about source assembly, where a good initial > approximation is to include the same files checked into git. > Use the sourceReleaseAssemblyDescriptor of maven-assembly-plugin: https://maven.apache.org/apache-resource-bundles/source-release/
Re: Can the jar plugin respect .gitignore?
... Right. I was thinking specifically about source assembly, where a good initial approximation is to include the same files checked into git. Obviously that's wrong for binary assembly, but having the option of "import ignore list into source excludes" would help keep the two in synch. And the basic selection pattern syntax seems close to the same. Not a big deal to maintain manually; I'm just looking to automate what I can. -- /_ Joe Kesselman (he/him/his) -/ _) My Alexa skill for New Music/New Sounds fans: / https://www.amazon.com/dp/B09WJ3H657/ () Plaintext Ribbon Campaign /\ Stamp out HTML mail! From: John Patrick Sent: Saturday, November 11, 2023 6:18:43 AM To: Maven Users List Subject: Re: Can the jar plugin respect .gitignore? my .gitignore includes target, so that would probably cause more issues with the assembly plugin. On Fri, 10 Nov 2023 at 21:34, wrote: > I think there are two issues with this, first of all git is not the only > SCM, so why prefer it’s file. > > But secondly it is very common that binary result artifacts are git > ignored and exactly the stuff you want to package. For example target/ > > Are you thinking about -src archives, only? > > Having said that, supporting the file format and patterns might be a good > idea (if it can be sorted out which directory level should be relevant) and > having a easy way to enable .*ignore. > > Joseph Kessselman wrote on 10. Nov 2023 19:42 (GMT +01:00): > > > (Or, equivalently be told to take exclude list from a file in .gitignore > > syntax and then be told .gitignore was that file.) > > > > If not, I'd consider that worth adding. > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: Can the jar plugin respect .gitignore?
my .gitignore includes target, so that would probably cause more issues with the assembly plugin. On Fri, 10 Nov 2023 at 21:34, wrote: > I think there are two issues with this, first of all git is not the only > SCM, so why prefer it’s file. > > But secondly it is very common that binary result artifacts are git > ignored and exactly the stuff you want to package. For example target/ > > Are you thinking about -src archives, only? > > Having said that, supporting the file format and patterns might be a good > idea (if it can be sorted out which directory level should be relevant) and > having a easy way to enable .*ignore. > > Joseph Kessselman wrote on 10. Nov 2023 19:42 (GMT +01:00): > > > (Or, equivalently be told to take exclude list from a file in .gitignore > > syntax and then be told .gitignore was that file.) > > > > If not, I'd consider that worth adding. > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: Can the jar plugin respect .gitignore?
I think there are two issues with this, first of all git is not the only SCM, so why prefer it’s file. But secondly it is very common that binary result artifacts are git ignored and exactly the stuff you want to package. For example target/ Are you thinking about -src archives, only? Having said that, supporting the file format and patterns might be a good idea (if it can be sorted out which directory level should be relevant) and having a easy way to enable .*ignore. Joseph Kessselman wrote on 10. Nov 2023 19:42 (GMT +01:00): > (Or, equivalently be told to take exclude list from a file in .gitignore > syntax and then be told .gitignore was that file.) > > If not, I'd consider that worth adding. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can the jar plugin respect .gitignore?
... Actually, correction -- not the jar plugin, the assembly plugin. (sigh) On 11/10/2023 1:42 PM, Joseph Kessselman wrote: (Or, equivalently be told to take exclude list from a file in .gitignore syntax and then be told .gitignore was that file.) If not, I'd consider that worth adding. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org