Re: Re: What could cause a missing JAR in WEB-INF?
Glad that it was resolved. Still, I have to add a remark: purging your local repo (literally "nuking", just rm -r ~/.m2/repository) is "good thing" and should be part of regular "workstation hygiene" just like updating OS and tools is. Remember, that "local repo" is, as you rightfully say "a cache", and as such (and via MANY tools that also write to it, like IDEs, CLI tools etc) it may become corrupted. Moreover, by regularly nuking it, you ensure that the project is rebuildable even if your laptop/workstation/flat is gone in some disaster. I regularly build against "pristine local repo" (ie. -Dmaven.repo.local=foo) from time to time, just to ensure that all is okay, and sometimes even check the contents of local repo (check for unexpected "guests"). Thanks T On Tue, Apr 18, 2023 at 8:17 PM Thad Humphries wrote: > Ah ha! It *was* the Maven cache. Thank you for getting me to take another > look. > > I had been looking at the files for the transient library, xml-apis. That > all checked out. Just now I looked one higher, at the library that was > bringing in xml-apis (com.megginson.sax:xml-writer:0.2). *That* didn't > match. So I ran `mvn dependency:purge-local-repository` on it, which pulled > in files that match my office machine. Now the app builds match (both now > include xml-apis, so long as I don't specifically exclude it). > > As to what caused the cache difference to begin with, from the cache dates > I believe that my home machine got its files from an old Archiva server. It > crashed last October, and I replaced it with Nexus 3 running on other > hardware. Whatever the cause, it's straight now. > > Thank you for prodding me. After two days away, I was able to come back > with a fresh outlook. > > On Tue, Apr 18, 2023 at 11:33 AM Eric Bresie wrote: > > > Any chance there are some conflicting profile or differences in > > settings.xml on the different machines? > > > > Maybe maven caches is different and needs cleanup? > > > > Eric Bresie > > ebre...@gmail.com (mailto:ebre...@gmail.com) > > > > > On April 16, 2023 at 7:36:36 AM CDT, Thad Humphries < > > thad.humphr...@gmail.com (mailto:thad.humphr...@gmail.com)> wrote: > > > There are no profiles in the pom.xml that brings in the jar in > question, > > > xml-apis ( > > > > > > https://repo1.maven.org/maven2/com/megginson/sax/xml-writer/0.2/xml-writer-0.2.pom > > ). > > > Since the webapp works without it, I'll exclude it from the build. > > > > > > On Sat, Apr 15, 2023 at 7:30 PM Tomo Suzuki > (mailto:suzt...@google.com.invalid)> > > > wrote: > > > > > > > > The pom.xml has 2 profiles > > > > > > > > I meant the pom file that delcares the missing dependency. Your > > > > (transitive) dependency's pom.xml. > > > > > > > > On Sat, Apr 15, 2023 at 13:29 Thad Humphries < > thad.humphr...@gmail.com > > (mailto:thad.humphr...@gmail.com)> > > > > wrote: > > > > > > > > > Thanks. I might be missing something but I can't see it. Responses > > > > inline. > > > > > > > > > > On Sat, Apr 15, 2023 at 12:00 PM Tomo Suzuki > > mailto:suzt...@google.com.invalid) > > > > > > > > > > wrote: > > > > > > > > > > > My guess > > > > > > > > > > > > - Maven profiles activated based on environment > > > > > > > > > > > > > > > > The pom.xml has 2 profiles, both triggered by -P, not (that I know > > of) by > > > > > the environment. In any case, environments are (at least from the > > debug) > > > > > the same except for "java.awt.headless: true" in the debug from the > > > > office > > > > > Mac that I telnet into. That's the Mini with the extra JAR, but my > > > > MacBook > > > > > has it, too, and it's here with me. > > > > > > > > > > Of the two declared profiles, one profile selects GWT devmode, > while > > the > > > > > other packages the *war. In all the cases that I am describing, I'm > > > > > using the packaging profile. Each time the command is > > > > > > > > > > $ mvn clean exec:exec -Dexec.executable="xslt" package -P package > > > > > > > > > > (The exec:exec builds the webapp's online manual using DocBook. > It's > > > > later > > > > > copied into the *war. Same DocBook version, same version of > > xsltproc.) > > > > > > > > > > Running `mvn help:effective-settings` shows the same settings on > each > > > > > machine except for hostnames. Is there another command I should > try? > > > > > > > > > > > > > > > > - Download URL was unavailable > > > > > > > > > > > > > > > > I don't think so. I've packaged this dozens of times over the past > 3 > > days > > > > > with the same results each time. The Git and Nexus servers are > > inside the > > > > > office, but I've had no connection issues with them. I have a VPN > to > > > > > everything there. > > > > > > > > > > > > > > > > or > > > > > > - Disk was full when downloading > > > > > > > > > > > > > > > > Both Mac Minis have 1.12TB Fusion drives with over 50% free. > > > > > > > > > > > > > > > > > > > > > > On Fri, Apr 14, 2023 at 15:34 Thad Humphries < > > thad.humphr...@gmail.com (mailto:thad.hu
Re: Re: What could cause a missing JAR in WEB-INF?
Ah ha! It *was* the Maven cache. Thank you for getting me to take another look. I had been looking at the files for the transient library, xml-apis. That all checked out. Just now I looked one higher, at the library that was bringing in xml-apis (com.megginson.sax:xml-writer:0.2). *That* didn't match. So I ran `mvn dependency:purge-local-repository` on it, which pulled in files that match my office machine. Now the app builds match (both now include xml-apis, so long as I don't specifically exclude it). As to what caused the cache difference to begin with, from the cache dates I believe that my home machine got its files from an old Archiva server. It crashed last October, and I replaced it with Nexus 3 running on other hardware. Whatever the cause, it's straight now. Thank you for prodding me. After two days away, I was able to come back with a fresh outlook. On Tue, Apr 18, 2023 at 11:33 AM Eric Bresie wrote: > Any chance there are some conflicting profile or differences in > settings.xml on the different machines? > > Maybe maven caches is different and needs cleanup? > > Eric Bresie > ebre...@gmail.com (mailto:ebre...@gmail.com) > > > On April 16, 2023 at 7:36:36 AM CDT, Thad Humphries < > thad.humphr...@gmail.com (mailto:thad.humphr...@gmail.com)> wrote: > > There are no profiles in the pom.xml that brings in the jar in question, > > xml-apis ( > > > https://repo1.maven.org/maven2/com/megginson/sax/xml-writer/0.2/xml-writer-0.2.pom > ). > > Since the webapp works without it, I'll exclude it from the build. > > > > On Sat, Apr 15, 2023 at 7:30 PM Tomo Suzuki (mailto:suzt...@google.com.invalid)> > > wrote: > > > > > > The pom.xml has 2 profiles > > > > > > I meant the pom file that delcares the missing dependency. Your > > > (transitive) dependency's pom.xml. > > > > > > On Sat, Apr 15, 2023 at 13:29 Thad Humphries (mailto:thad.humphr...@gmail.com)> > > > wrote: > > > > > > > Thanks. I might be missing something but I can't see it. Responses > > > inline. > > > > > > > > On Sat, Apr 15, 2023 at 12:00 PM Tomo Suzuki > mailto:suzt...@google.com.invalid) > > > > > > > > wrote: > > > > > > > > > My guess > > > > > > > > > > - Maven profiles activated based on environment > > > > > > > > > > > > > The pom.xml has 2 profiles, both triggered by -P, not (that I know > of) by > > > > the environment. In any case, environments are (at least from the > debug) > > > > the same except for "java.awt.headless: true" in the debug from the > > > office > > > > Mac that I telnet into. That's the Mini with the extra JAR, but my > > > MacBook > > > > has it, too, and it's here with me. > > > > > > > > Of the two declared profiles, one profile selects GWT devmode, while > the > > > > other packages the *war. In all the cases that I am describing, I'm > > > > using the packaging profile. Each time the command is > > > > > > > > $ mvn clean exec:exec -Dexec.executable="xslt" package -P package > > > > > > > > (The exec:exec builds the webapp's online manual using DocBook. It's > > > later > > > > copied into the *war. Same DocBook version, same version of > xsltproc.) > > > > > > > > Running `mvn help:effective-settings` shows the same settings on each > > > > machine except for hostnames. Is there another command I should try? > > > > > > > > > > > > > - Download URL was unavailable > > > > > > > > > > > > > I don't think so. I've packaged this dozens of times over the past 3 > days > > > > with the same results each time. The Git and Nexus servers are > inside the > > > > office, but I've had no connection issues with them. I have a VPN to > > > > everything there. > > > > > > > > > > > > > or > > > > > - Disk was full when downloading > > > > > > > > > > > > > Both Mac Minis have 1.12TB Fusion drives with over 50% free. > > > > > > > > > > > > > > > > > > On Fri, Apr 14, 2023 at 15:34 Thad Humphries < > thad.humphr...@gmail.com (mailto:thad.humphr...@gmail.com) > > > > > > > > > wrote: > > > > > > > > > > > I have *war that I've built on 3 different Macs (maven-war-plugin > > > > 3.3.2). > > > > > > The code is pulled from my local git repo, and the supporting > jars > > > are > > > > > from > > > > > > a local Nexus repository. All Macs use the same setup--Amazon > > > Corretto > > > > > Java > > > > > > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of > the > > > > Macs > > > > > > produce the same *war (a Mini with 10.15.7 and a MacBook with > > > 12.6.5). > > > > > The > > > > > > third Mac--also a Mini with 10.15.7--is missing one JAR file in > > > > > > WEB-INF/lib. How can this be? > > > > > > > > > > > > The missing JAR is in each local repository. I do not see this > JAR > > > > when I > > > > > > run `mvn dependency:tree`, though I see a different (newer) > version > > > as > > > > > > "provided." The missing JAR doesn't seem to matter when the > webapp > > > runs > > > > > (no > > > > > > problems found so far). Any idea as to why, and what I can (or > > > should?) > > > > > do > > > > >
Re: Re: What could cause a missing JAR in WEB-INF?
Any chance there are some conflicting profile or differences in settings.xml on the different machines? Maybe maven caches is different and needs cleanup? Eric Bresie ebre...@gmail.com (mailto:ebre...@gmail.com) > On April 16, 2023 at 7:36:36 AM CDT, Thad Humphries (mailto:thad.humphr...@gmail.com)> wrote: > There are no profiles in the pom.xml that brings in the jar in question, > xml-apis ( > https://repo1.maven.org/maven2/com/megginson/sax/xml-writer/0.2/xml-writer-0.2.pom). > Since the webapp works without it, I'll exclude it from the build. > > On Sat, Apr 15, 2023 at 7:30 PM Tomo Suzuki (mailto:suzt...@google.com.invalid)> > wrote: > > > > The pom.xml has 2 profiles > > > > I meant the pom file that delcares the missing dependency. Your > > (transitive) dependency's pom.xml. > > > > On Sat, Apr 15, 2023 at 13:29 Thad Humphries > (mailto:thad.humphr...@gmail.com)> > > wrote: > > > > > Thanks. I might be missing something but I can't see it. Responses > > inline. > > > > > > On Sat, Apr 15, 2023 at 12:00 PM Tomo Suzuki > > (mailto:suzt...@google.com.invalid) > > > > > > wrote: > > > > > > > My guess > > > > > > > > - Maven profiles activated based on environment > > > > > > > > > > The pom.xml has 2 profiles, both triggered by -P, not (that I know of) by > > > the environment. In any case, environments are (at least from the debug) > > > the same except for "java.awt.headless: true" in the debug from the > > office > > > Mac that I telnet into. That's the Mini with the extra JAR, but my > > MacBook > > > has it, too, and it's here with me. > > > > > > Of the two declared profiles, one profile selects GWT devmode, while the > > > other packages the *war. In all the cases that I am describing, I'm > > > using the packaging profile. Each time the command is > > > > > > $ mvn clean exec:exec -Dexec.executable="xslt" package -P package > > > > > > (The exec:exec builds the webapp's online manual using DocBook. It's > > later > > > copied into the *war. Same DocBook version, same version of xsltproc.) > > > > > > Running `mvn help:effective-settings` shows the same settings on each > > > machine except for hostnames. Is there another command I should try? > > > > > > > > > > - Download URL was unavailable > > > > > > > > > > I don't think so. I've packaged this dozens of times over the past 3 days > > > with the same results each time. The Git and Nexus servers are inside the > > > office, but I've had no connection issues with them. I have a VPN to > > > everything there. > > > > > > > > > > or > > > > - Disk was full when downloading > > > > > > > > > > Both Mac Minis have 1.12TB Fusion drives with over 50% free. > > > > > > > > > > > > > > On Fri, Apr 14, 2023 at 15:34 Thad Humphries > > > (mailto:thad.humphr...@gmail.com) > > > > > > > wrote: > > > > > > > > > I have *war that I've built on 3 different Macs (maven-war-plugin > > > 3.3.2). > > > > > The code is pulled from my local git repo, and the supporting jars > > are > > > > from > > > > > a local Nexus repository. All Macs use the same setup--Amazon > > Corretto > > > > Java > > > > > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the > > > Macs > > > > > produce the same *war (a Mini with 10.15.7 and a MacBook with > > 12.6.5). > > > > The > > > > > third Mac--also a Mini with 10.15.7--is missing one JAR file in > > > > > WEB-INF/lib. How can this be? > > > > > > > > > > The missing JAR is in each local repository. I do not see this JAR > > > when I > > > > > run `mvn dependency:tree`, though I see a different (newer) version > > as > > > > > "provided." The missing JAR doesn't seem to matter when the webapp > > runs > > > > (no > > > > > problems found so far). Any idea as to why, and what I can (or > > should?) > > > > do > > > > > for a consistent build? > > > > > > > > > > -- > > > > > "Hell hath no limits, nor is circumscrib'd In one self-place; but > > where > > > > we > > > > > are is hell, And where hell is, there must we ever be" --Christopher > > > > > Marlowe, *Doctor Faustus* (v. 111-13) > > > > > > > > > -- > > > > Regards, > > > > Tomo > > > > > > > > > > > > > -- > > > "Hell hath no limits, nor is circumscrib'd In one self-place; but where > > we > > > are is hell, And where hell is, there must we ever be" --Christopher > > > Marlowe, *Doctor Faustus* (v. 111-13) > > > > > -- > > Regards, > > Tomo > > > > > -- > "Hell hath no limits, nor is circumscrib'd In one self-place; but where we > are is hell, And where hell is, there must we ever be" --Christopher > Marlowe, *Doctor Faustus* (v. 111-13)
Re: What could cause a missing JAR in WEB-INF?
There are no profiles in the pom.xml that brings in the jar in question, xml-apis ( https://repo1.maven.org/maven2/com/megginson/sax/xml-writer/0.2/xml-writer-0.2.pom). Since the webapp works without it, I'll exclude it from the build. On Sat, Apr 15, 2023 at 7:30 PM Tomo Suzuki wrote: > > The pom.xml has 2 profiles > > I meant the pom file that delcares the missing dependency. Your > (transitive) dependency's pom.xml. > > On Sat, Apr 15, 2023 at 13:29 Thad Humphries > wrote: > > > Thanks. I might be missing something but I can't see it. Responses > inline. > > > > On Sat, Apr 15, 2023 at 12:00 PM Tomo Suzuki > > > wrote: > > > > > My guess > > > > > > - Maven profiles activated based on environment > > > > > > > The pom.xml has 2 profiles, both triggered by -P, not (that I know of) by > > the environment. In any case, environments are (at least from the debug) > > the same except for "java.awt.headless: true" in the debug from the > office > > Mac that I telnet into. That's the Mini with the extra JAR, but my > MacBook > > has it, too, and it's here with me. > > > > Of the two declared profiles, one profile selects GWT devmode, while the > > other packages the *war. In all the cases that I am describing, I'm > > using the packaging profile. Each time the command is > > > > $ mvn clean exec:exec -Dexec.executable="xslt" package -P package > > > > (The exec:exec builds the webapp's online manual using DocBook. It's > later > > copied into the *war. Same DocBook version, same version of xsltproc.) > > > > Running `mvn help:effective-settings` shows the same settings on each > > machine except for hostnames. Is there another command I should try? > > > > > > > - Download URL was unavailable > > > > > > > I don't think so. I've packaged this dozens of times over the past 3 days > > with the same results each time. The Git and Nexus servers are inside the > > office, but I've had no connection issues with them. I have a VPN to > > everything there. > > > > > > > or > > > - Disk was full when downloading > > > > > > > Both Mac Minis have 1.12TB Fusion drives with over 50% free. > > > > > > > > > > On Fri, Apr 14, 2023 at 15:34 Thad Humphries > > > > wrote: > > > > > > > I have *war that I've built on 3 different Macs (maven-war-plugin > > 3.3.2). > > > > The code is pulled from my local git repo, and the supporting jars > are > > > from > > > > a local Nexus repository. All Macs use the same setup--Amazon > Corretto > > > Java > > > > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the > > Macs > > > > produce the same *war (a Mini with 10.15.7 and a MacBook with > 12.6.5). > > > The > > > > third Mac--also a Mini with 10.15.7--is missing one JAR file in > > > > WEB-INF/lib. How can this be? > > > > > > > > The missing JAR is in each local repository. I do not see this JAR > > when I > > > > run `mvn dependency:tree`, though I see a different (newer) version > as > > > > "provided." The missing JAR doesn't seem to matter when the webapp > runs > > > (no > > > > problems found so far). Any idea as to why, and what I can (or > should?) > > > do > > > > for a consistent build? > > > > > > > > -- > > > > "Hell hath no limits, nor is circumscrib'd In one self-place; but > where > > > we > > > > are is hell, And where hell is, there must we ever be" --Christopher > > > > Marlowe, *Doctor Faustus* (v. 111-13) > > > > > > > -- > > > Regards, > > > Tomo > > > > > > > > > -- > > "Hell hath no limits, nor is circumscrib'd In one self-place; but where > we > > are is hell, And where hell is, there must we ever be" --Christopher > > Marlowe, *Doctor Faustus* (v. 111-13) > > > -- > Regards, > Tomo > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v. 111-13)
Re: What could cause a missing JAR in WEB-INF?
Thanks for the link about Xerces. We've had run-ins with it in the past. For now I'm going with your recommendation to exclude xml-apis from the build. The com.megginson.sax:xml-writer is used in one place, and that is working fine (though I'll make a note in the pom about it). On Sat, Apr 15, 2023 at 1:51 PM Greg Chabala wrote: > It's no surprise that Xerces is involved here. Some colorful background: > > https://stackoverflow.com/questions/11677572/dealing-with-xerces-hell-in-java-maven > > The crux is clearly that xml-apis is a transitive dependency in two places, > and depending on which is elected vs evicted, it will be compile or > provided scope, and therefore in the WAR or not. > > This case might be of interest to the reproducible builds folks, since I > would have thought it was deterministic, but it seems like your pom as > written currently is letting it waffle. > > In any case, you should be able to force the behavior to be stable by > declaring a direct dependency on xml-apis. Whether it should be compile or > provided scope, or if you prefer to exclude it entirely instead, will take > some more work. > > Looking at GWT, it seems like gwt-dev is provided because it's intended for > compile only, and runtime requirements are in the gwt-servlet artifact, > which I presume is also declared in your pom. I suspect Xerces and xml-api, > as well as htmlunit, are never needed by GWT at runtime, or are provided by > other artifacts or the application server. > > Looking at com.megginson.sax:xml-writer, it appears to really depend on > xml-api, although it is an older version. If your application still works > without xml-api present, exclusion might be the best option. > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v. 111-13)
Re: What could cause a missing JAR in WEB-INF?
> The pom.xml has 2 profiles I meant the pom file that delcares the missing dependency. Your (transitive) dependency's pom.xml. On Sat, Apr 15, 2023 at 13:29 Thad Humphries wrote: > Thanks. I might be missing something but I can't see it. Responses inline. > > On Sat, Apr 15, 2023 at 12:00 PM Tomo Suzuki > wrote: > > > My guess > > > > - Maven profiles activated based on environment > > > > The pom.xml has 2 profiles, both triggered by -P, not (that I know of) by > the environment. In any case, environments are (at least from the debug) > the same except for "java.awt.headless: true" in the debug from the office > Mac that I telnet into. That's the Mini with the extra JAR, but my MacBook > has it, too, and it's here with me. > > Of the two declared profiles, one profile selects GWT devmode, while the > other packages the *war. In all the cases that I am describing, I'm > using the packaging profile. Each time the command is > > $ mvn clean exec:exec -Dexec.executable="xslt" package -P package > > (The exec:exec builds the webapp's online manual using DocBook. It's later > copied into the *war. Same DocBook version, same version of xsltproc.) > > Running `mvn help:effective-settings` shows the same settings on each > machine except for hostnames. Is there another command I should try? > > > > - Download URL was unavailable > > > > I don't think so. I've packaged this dozens of times over the past 3 days > with the same results each time. The Git and Nexus servers are inside the > office, but I've had no connection issues with them. I have a VPN to > everything there. > > > > or > > - Disk was full when downloading > > > > Both Mac Minis have 1.12TB Fusion drives with over 50% free. > > > > > > On Fri, Apr 14, 2023 at 15:34 Thad Humphries > > wrote: > > > > > I have *war that I've built on 3 different Macs (maven-war-plugin > 3.3.2). > > > The code is pulled from my local git repo, and the supporting jars are > > from > > > a local Nexus repository. All Macs use the same setup--Amazon Corretto > > Java > > > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the > Macs > > > produce the same *war (a Mini with 10.15.7 and a MacBook with 12.6.5). > > The > > > third Mac--also a Mini with 10.15.7--is missing one JAR file in > > > WEB-INF/lib. How can this be? > > > > > > The missing JAR is in each local repository. I do not see this JAR > when I > > > run `mvn dependency:tree`, though I see a different (newer) version as > > > "provided." The missing JAR doesn't seem to matter when the webapp runs > > (no > > > problems found so far). Any idea as to why, and what I can (or should?) > > do > > > for a consistent build? > > > > > > -- > > > "Hell hath no limits, nor is circumscrib'd In one self-place; but where > > we > > > are is hell, And where hell is, there must we ever be" --Christopher > > > Marlowe, *Doctor Faustus* (v. 111-13) > > > > > -- > > Regards, > > Tomo > > > > > -- > "Hell hath no limits, nor is circumscrib'd In one self-place; but where we > are is hell, And where hell is, there must we ever be" --Christopher > Marlowe, *Doctor Faustus* (v. 111-13) > -- Regards, Tomo
Re: What could cause a missing JAR in WEB-INF?
Ok, thanks. A reproducer would be great. But FTR, this is what I get (mvn 3.9.1, bf, "normal" and "verbose"): https://gist.github.com/cstamas/7f027113d872e1b9941337916931c724 T On Sat, Apr 15, 2023 at 11:04 PM Greg Chabala wrote: > > > > Are you saying that Maven dependency resolving is not deterministic? > > > > I expect the resolution to be deterministic. But from all that has been > shared here so far, it looks like something non-deterministic is happening, > or perhaps more accurately, it is deterministic per machine, but varies due > some unknown property outside the pom. It might even be a bug. > > I would encourage Thad to see if he can make a project that reproduces the > issue that he could share. >
Re: What could cause a missing JAR in WEB-INF?
> > Are you saying that Maven dependency resolving is not deterministic? > I expect the resolution to be deterministic. But from all that has been shared here so far, it looks like something non-deterministic is happening, or perhaps more accurately, it is deterministic per machine, but varies due some unknown property outside the pom. It might even be a bug. I would encourage Thad to see if he can make a project that reproduces the issue that he could share.
Re: What could cause a missing JAR in WEB-INF?
Greg, Are you saying that Maven dependency resolving is not deterministic? Thanks T On Sat, Apr 15, 2023 at 7:50 PM Greg Chabala wrote: > It's no surprise that Xerces is involved here. Some colorful background: > > https://stackoverflow.com/questions/11677572/dealing-with-xerces-hell-in-java-maven > > The crux is clearly that xml-apis is a transitive dependency in two places, > and depending on which is elected vs evicted, it will be compile or > provided scope, and therefore in the WAR or not. > > This case might be of interest to the reproducible builds folks, since I > would have thought it was deterministic, but it seems like your pom as > written currently is letting it waffle. > > In any case, you should be able to force the behavior to be stable by > declaring a direct dependency on xml-apis. Whether it should be compile or > provided scope, or if you prefer to exclude it entirely instead, will take > some more work. > > Looking at GWT, it seems like gwt-dev is provided because it's intended for > compile only, and runtime requirements are in the gwt-servlet artifact, > which I presume is also declared in your pom. I suspect Xerces and xml-api, > as well as htmlunit, are never needed by GWT at runtime, or are provided by > other artifacts or the application server. > > Looking at com.megginson.sax:xml-writer, it appears to really depend on > xml-api, although it is an older version. If your application still works > without xml-api present, exclusion might be the best option. >
Re: What could cause a missing JAR in WEB-INF?
If the versions of Maven (hence of the dependency resolution lib) and maven-dependency-plugin (might interpret trees differently, but given maven-war-plugin also behaves differently I'd rather blame Maven) are the same, and you have no differing extension neither, then I have no idea sorry. Le sam. 15 avr. 2023 à 17:24, Thad Humphries a écrit : > Except for the times, the effective poms are identical between the two Mac > Minis. > > From the dependency trees, I see what I see in the debug output. The build > without the xml-apis-1.0.b2.jar shows (condensing) > > [INFO] +- com.google.gwt:gwt-dev:jar:2.8.2:provided > [INFO] | +- net.sourceforge.htmlunit:htmlunit:jar:2.19:provided > [INFO] | | +- xerces:xercesImpl:jar:2.11.0:provided > [INFO] | | | \- xml-apis:xml-apis:jar:1.4.01:provided > [INFO] | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:provided > ... > [INFO] +- com.megginson.sax:xml-writer:jar:0.2:compile > > while the other shows > > [INFO] +- com.google.gwt:gwt-dev:jar:2.8.2:provided > [INFO] | +- net.sourceforge.htmlunit:htmlunit:jar:2.19:provided > [INFO] | | +- xerces:xercesImpl:jar:2.11.0:provided > [INFO] | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:provided > ... > [INFO] +- com.megginson.sax:xml-writer:jar:0.2:compile > [INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile > > So for some reason the machines see a different requirement for > xml-apis-*.jar > > > On Fri, Apr 14, 2023 at 4:12 PM Thomas Broyer wrote: > > > Have you tried diffing the effective-pom on the various machines? > > How about running with debug logs? Does the waven-war-plugin maybe > outputs > > why it picks or excludes dependencies from the war? > > > > Le ven. 14 avr. 2023 à 21:34, Thad Humphries > a > > écrit : > > > > > I have *war that I've built on 3 different Macs (maven-war-plugin > 3.3.2). > > > The code is pulled from my local git repo, and the supporting jars are > > from > > > a local Nexus repository. All Macs use the same setup--Amazon Corretto > > Java > > > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the > Macs > > > produce the same *war (a Mini with 10.15.7 and a MacBook with 12.6.5). > > The > > > third Mac--also a Mini with 10.15.7--is missing one JAR file in > > > WEB-INF/lib. How can this be? > > > > > > The missing JAR is in each local repository. I do not see this JAR > when I > > > run `mvn dependency:tree`, though I see a different (newer) version as > > > "provided." The missing JAR doesn't seem to matter when the webapp runs > > (no > > > problems found so far). Any idea as to why, and what I can (or should?) > > do > > > for a consistent build? > > > > > > -- > > > "Hell hath no limits, nor is circumscrib'd In one self-place; but where > > we > > > are is hell, And where hell is, there must we ever be" --Christopher > > > Marlowe, *Doctor Faustus* (v. 111-13) > > > > > > > > -- > "Hell hath no limits, nor is circumscrib'd In one self-place; but where we > are is hell, And where hell is, there must we ever be" --Christopher > Marlowe, *Doctor Faustus* (v. 111-13) >
Re: What could cause a missing JAR in WEB-INF?
It's no surprise that Xerces is involved here. Some colorful background: https://stackoverflow.com/questions/11677572/dealing-with-xerces-hell-in-java-maven The crux is clearly that xml-apis is a transitive dependency in two places, and depending on which is elected vs evicted, it will be compile or provided scope, and therefore in the WAR or not. This case might be of interest to the reproducible builds folks, since I would have thought it was deterministic, but it seems like your pom as written currently is letting it waffle. In any case, you should be able to force the behavior to be stable by declaring a direct dependency on xml-apis. Whether it should be compile or provided scope, or if you prefer to exclude it entirely instead, will take some more work. Looking at GWT, it seems like gwt-dev is provided because it's intended for compile only, and runtime requirements are in the gwt-servlet artifact, which I presume is also declared in your pom. I suspect Xerces and xml-api, as well as htmlunit, are never needed by GWT at runtime, or are provided by other artifacts or the application server. Looking at com.megginson.sax:xml-writer, it appears to really depend on xml-api, although it is an older version. If your application still works without xml-api present, exclusion might be the best option.
Re: What could cause a missing JAR in WEB-INF?
Thanks. I might be missing something but I can't see it. Responses inline. On Sat, Apr 15, 2023 at 12:00 PM Tomo Suzuki wrote: > My guess > > - Maven profiles activated based on environment > The pom.xml has 2 profiles, both triggered by -P, not (that I know of) by the environment. In any case, environments are (at least from the debug) the same except for "java.awt.headless: true" in the debug from the office Mac that I telnet into. That's the Mini with the extra JAR, but my MacBook has it, too, and it's here with me. Of the two declared profiles, one profile selects GWT devmode, while the other packages the *war. In all the cases that I am describing, I'm using the packaging profile. Each time the command is $ mvn clean exec:exec -Dexec.executable="xslt" package -P package (The exec:exec builds the webapp's online manual using DocBook. It's later copied into the *war. Same DocBook version, same version of xsltproc.) Running `mvn help:effective-settings` shows the same settings on each machine except for hostnames. Is there another command I should try? > - Download URL was unavailable > I don't think so. I've packaged this dozens of times over the past 3 days with the same results each time. The Git and Nexus servers are inside the office, but I've had no connection issues with them. I have a VPN to everything there. > or > - Disk was full when downloading > Both Mac Minis have 1.12TB Fusion drives with over 50% free. > > On Fri, Apr 14, 2023 at 15:34 Thad Humphries > wrote: > > > I have *war that I've built on 3 different Macs (maven-war-plugin 3.3.2). > > The code is pulled from my local git repo, and the supporting jars are > from > > a local Nexus repository. All Macs use the same setup--Amazon Corretto > Java > > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the Macs > > produce the same *war (a Mini with 10.15.7 and a MacBook with 12.6.5). > The > > third Mac--also a Mini with 10.15.7--is missing one JAR file in > > WEB-INF/lib. How can this be? > > > > The missing JAR is in each local repository. I do not see this JAR when I > > run `mvn dependency:tree`, though I see a different (newer) version as > > "provided." The missing JAR doesn't seem to matter when the webapp runs > (no > > problems found so far). Any idea as to why, and what I can (or should?) > do > > for a consistent build? > > > > -- > > "Hell hath no limits, nor is circumscrib'd In one self-place; but where > we > > are is hell, And where hell is, there must we ever be" --Christopher > > Marlowe, *Doctor Faustus* (v. 111-13) > > > -- > Regards, > Tomo > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v. 111-13)
Re: What could cause a missing JAR in WEB-INF?
My guess - Maven profiles activated based on environment - Download URL was unavailable or - Disk was full when downloading On Fri, Apr 14, 2023 at 15:34 Thad Humphries wrote: > I have *war that I've built on 3 different Macs (maven-war-plugin 3.3.2). > The code is pulled from my local git repo, and the supporting jars are from > a local Nexus repository. All Macs use the same setup--Amazon Corretto Java > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the Macs > produce the same *war (a Mini with 10.15.7 and a MacBook with 12.6.5). The > third Mac--also a Mini with 10.15.7--is missing one JAR file in > WEB-INF/lib. How can this be? > > The missing JAR is in each local repository. I do not see this JAR when I > run `mvn dependency:tree`, though I see a different (newer) version as > "provided." The missing JAR doesn't seem to matter when the webapp runs (no > problems found so far). Any idea as to why, and what I can (or should?) do > for a consistent build? > > -- > "Hell hath no limits, nor is circumscrib'd In one self-place; but where we > are is hell, And where hell is, there must we ever be" --Christopher > Marlowe, *Doctor Faustus* (v. 111-13) > -- Regards, Tomo
Re: What could cause a missing JAR in WEB-INF?
Answers inline: On Fri, Apr 14, 2023 at 4:16 PM Greg Chabala wrote: > > I have *war that I've built on 3 different Macs (maven-war-plugin 3.3.2). > > > > Is there a reason you're rebuilding your WAR three times on different Macs? > One Mac Mini is my home machine, the other is the office machine. I'm 60%/40% home or office, and I try to keep them in sync as much as possible (excluding personal files). The laptop (a personal machine) I take with me for the times I'm called to check on something while out-of-town. > > The code is pulled from my local git repo, and the supporting jars are > from > > a local Nexus repository. > > Are they all building from the same git branch/ref? Everything is pulled > current? > Yes. > The missing JAR is in each local repository. I do not see this JAR when I > > run `mvn dependency:tree`, though I see a different (newer) version as > > "provided." > > Provided means you are in charge of supplying the JAR, not Maven. Typically > this means you expect the JAR will already be available at runtime, e.g. in > your application server's provided JARs, so there's no point in bundling it > into your WAR. Are you certain this is not just a case of having different > application server versions installed, or someone manually updated the > provided JARs on one of them? > Currently I'm using Tomcat 9.0.70 on each Mac. They are set up the same way. > The missing JAR doesn't seem to matter when the webapp runs (no > > problems found so far). Any idea as to why, and > > > what I can (or should?) do for a consistent build? > > Make sure you're not using version ranges, and that all versions are > specified. For more tips, see: > https://maven.apache.org/guides/mini/guide-reproducible-builds.html > > This is all hypothetical, you didn't show/reference a concrete example pom > we could look at. > Thanks. I'll look into the reproducible builds guide. -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v. 111-13)
Re: What could cause a missing JAR in WEB-INF?
Except for the times, the effective poms are identical between the two Mac Minis. >From the dependency trees, I see what I see in the debug output. The build without the xml-apis-1.0.b2.jar shows (condensing) [INFO] +- com.google.gwt:gwt-dev:jar:2.8.2:provided [INFO] | +- net.sourceforge.htmlunit:htmlunit:jar:2.19:provided [INFO] | | +- xerces:xercesImpl:jar:2.11.0:provided [INFO] | | | \- xml-apis:xml-apis:jar:1.4.01:provided [INFO] | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:provided ... [INFO] +- com.megginson.sax:xml-writer:jar:0.2:compile while the other shows [INFO] +- com.google.gwt:gwt-dev:jar:2.8.2:provided [INFO] | +- net.sourceforge.htmlunit:htmlunit:jar:2.19:provided [INFO] | | +- xerces:xercesImpl:jar:2.11.0:provided [INFO] | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:provided ... [INFO] +- com.megginson.sax:xml-writer:jar:0.2:compile [INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile So for some reason the machines see a different requirement for xml-apis-*.jar On Fri, Apr 14, 2023 at 4:12 PM Thomas Broyer wrote: > Have you tried diffing the effective-pom on the various machines? > How about running with debug logs? Does the waven-war-plugin maybe outputs > why it picks or excludes dependencies from the war? > > Le ven. 14 avr. 2023 à 21:34, Thad Humphries a > écrit : > > > I have *war that I've built on 3 different Macs (maven-war-plugin 3.3.2). > > The code is pulled from my local git repo, and the supporting jars are > from > > a local Nexus repository. All Macs use the same setup--Amazon Corretto > Java > > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the Macs > > produce the same *war (a Mini with 10.15.7 and a MacBook with 12.6.5). > The > > third Mac--also a Mini with 10.15.7--is missing one JAR file in > > WEB-INF/lib. How can this be? > > > > The missing JAR is in each local repository. I do not see this JAR when I > > run `mvn dependency:tree`, though I see a different (newer) version as > > "provided." The missing JAR doesn't seem to matter when the webapp runs > (no > > problems found so far). Any idea as to why, and what I can (or should?) > do > > for a consistent build? > > > > -- > > "Hell hath no limits, nor is circumscrib'd In one self-place; but where > we > > are is hell, And where hell is, there must we ever be" --Christopher > > Marlowe, *Doctor Faustus* (v. 111-13) > > > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v. 111-13)
Re: What could cause a missing JAR in WEB-INF?
> I have *war that I've built on 3 different Macs (maven-war-plugin 3.3.2). > Is there a reason you're rebuilding your WAR three times on different Macs? > The code is pulled from my local git repo, and the supporting jars are from > a local Nexus repository. Are they all building from the same git branch/ref? Everything is pulled current? > The missing JAR is in each local repository. I do not see this JAR when I > run `mvn dependency:tree`, though I see a different (newer) version as > "provided." Provided means you are in charge of supplying the JAR, not Maven. Typically this means you expect the JAR will already be available at runtime, e.g. in your application server's provided JARs, so there's no point in bundling it into your WAR. Are you certain this is not just a case of having different application server versions installed, or someone manually updated the provided JARs on one of them? > The missing JAR doesn't seem to matter when the webapp runs (no > problems found so far). Any idea as to why, and > what I can (or should?) do for a consistent build? Make sure you're not using version ranges, and that all versions are specified. For more tips, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html This is all hypothetical, you didn't show/reference a concrete example pom we could look at.
Re: What could cause a missing JAR in WEB-INF?
Have you tried diffing the effective-pom on the various machines? How about running with debug logs? Does the waven-war-plugin maybe outputs why it picks or excludes dependencies from the war? Le ven. 14 avr. 2023 à 21:34, Thad Humphries a écrit : > I have *war that I've built on 3 different Macs (maven-war-plugin 3.3.2). > The code is pulled from my local git repo, and the supporting jars are from > a local Nexus repository. All Macs use the same setup--Amazon Corretto Java > 11 and Maven 3.9.1. The ~/.m2/settings.xml are identical. Two of the Macs > produce the same *war (a Mini with 10.15.7 and a MacBook with 12.6.5). The > third Mac--also a Mini with 10.15.7--is missing one JAR file in > WEB-INF/lib. How can this be? > > The missing JAR is in each local repository. I do not see this JAR when I > run `mvn dependency:tree`, though I see a different (newer) version as > "provided." The missing JAR doesn't seem to matter when the webapp runs (no > problems found so far). Any idea as to why, and what I can (or should?) do > for a consistent build? > > -- > "Hell hath no limits, nor is circumscrib'd In one self-place; but where we > are is hell, And where hell is, there must we ever be" --Christopher > Marlowe, *Doctor Faustus* (v. 111-13) >