Profile Activation
Hello All, I am having trouble getting a profile to activate. My scenario is as follows...I have a complicated build process for making webapps that includes xdoclet and jspc. I have all the necessary plugins defined in a profile on parent pom. I can't define those plugins in the normal section or the install of the parent pom itself fails. I have tried two ways to activate the pom. One is to use: build-web-profile false build-web true in my parent pom. Then I set true in the child pom. Doesn't work. Doesn't show up on help:active-profiles either. I even tried adding that property to my settings.xml and still nothing. Also tried using a file activation, which also fails. I read somewhere that that activation is still buggy though. Anybody have any other ideas on how to do this? Thanks in advance, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Profile Activation
Well, I realized my first mistake. Profiles are not inherited from poms. Uh oh. Anybody have any other ideas on how to do this? Thanks in advance, again! -Ben Ben Tatham wrote: Hello All, I am having trouble getting a profile to activate. My scenario is as follows...I have a complicated build process for making webapps that includes xdoclet and jspc. I have all the necessary plugins defined in a profile on parent pom. I can't define those plugins in the normal section or the install of the parent pom itself fails. I have tried two ways to activate the pom. One is to use: build-web-profile false build-web true in my parent pom. Then I set true in the child pom. Doesn't work. Doesn't show up on help:active-profiles either. I even tried adding that property to my settings.xml and still nothing. Also tried using a file activation, which also fails. I read somewhere that that activation is still buggy though. Anybody have any other ideas on how to do this? Thanks in advance, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Profile Activation
Nope. Apparently profiles are not inherited. Excerpt from POM Reference: The elements in the parent POM that are inherited by its children are: * dependencies * developers and contributors * plugin lists * reports lists * plugin executions with matching ids * plugin configuration Not profiles. Doh. Any other suggestions on how to share plugin setups between multiple projects? Thanks, Ben Mick Knutson wrote: try mvn -P build-web install -e On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Hello All, I am having trouble getting a profile to activate. My scenario is as follows...I have a complicated build process for making webapps that includes xdoclet and jspc. I have all the necessary plugins defined in a profile on parent pom. I can't define those plugins in the normal section or the install of the parent pom itself fails. I have tried two ways to activate the pom. One is to use: build-web-profile false build-web true in my parent pom. Then I set true in the child pom. Doesn't work. Doesn't show up on help:active-profiles either. I even tried adding that property to my settings.xml and still nothing. Also tried using a file activation, which also fails. I read somewhere that that activation is still buggy though. Anybody have any other ideas on how to do this? Thanks in advance, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Profile Activation
between projects -- we don't use modules. and the projects are pretty separate except for the build tools required. Is it possible to make my own plugin of plugins easily...with just xml? is there another solution for this? -Ben Mick Knutson wrote: Are you trying to share plugin info between projects, or modules? On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Nope. Apparently profiles are not inherited. Excerpt from POM Reference: The elements in the parent POM that are inherited by its children are: * dependencies * developers and contributors * plugin lists * reports lists * plugin executions with matching ids * plugin configuration Not profiles. Doh. Any other suggestions on how to share plugin setups between multiple projects? Thanks, Ben Mick Knutson wrote: > try mvn -P build-web install -e > > > On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: >> >> Hello All, >> I am having trouble getting a profile to activate. >> >> My scenario is as follows...I have a complicated build process for >> making webapps that includes xdoclet and jspc. I have all the necessary >> plugins defined in a profile on parent pom. I can't define those >> plugins in the normal section or the install of the >> parent pom itself fails. >> >> I have tried two ways to activate the pom. One is to use: >> >> build-web-profile >> >> false >> >> build-web >> true >> >> >> >> in my parent pom. Then I set >> >> >> true >> >> >> in the child pom. Doesn't work. Doesn't show up on >> help:active-profiles either. I even tried adding that property to my >> settings.xml and still nothing. >> >> Also tried using a file activation, which also fails. I read somewhere >> that that activation is still buggy though. >> >> Anybody have any other ideas on how to do this? >> >> Thanks in advance, >> Ben >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Profile Activation
basically, I have a parent pom...ie a maven project with pom Each of my projects use that as the . Option one sounds interesting...do submodules have to be subdirectories? Does the top-level pom module have to be able to build on its own, because it won't in my configuration because it expects certain directories to exist that don't exist except for in the real projects. Thanks for your continuing assistance... -Ben Mick Knutson wrote: Hmm. Not sure I understand. But you can always create a master pom, and have each of your projects create a sub module on your project that way they will always extend your master pom.xml for everyone. You could also mandate that each pom.xml only have access to your remote repo not the main maven repo, thus they will only have access to the plugins you have in your repo. But that does not help with the config of the plugins. On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: between projects -- we don't use modules. and the projects are pretty separate except for the build tools required. Is it possible to make my own plugin of plugins easily...with just xml? is there another solution for this? -Ben Mick Knutson wrote: > Are you trying to share plugin info between projects, or modules? > > > > > > > On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: >> >> Nope. Apparently profiles are not inherited. Excerpt from POM >> Reference: >> >> The elements in the parent POM that are inherited by its children are: >> >> * dependencies >> * developers and contributors >> * plugin lists >> * reports lists >> * plugin executions with matching ids >> * plugin configuration >> >> >> Not profiles. Doh. Any other suggestions on how to share plugin setups >> between multiple projects? >> >> Thanks, >> Ben >> >> Mick Knutson wrote: >> > try mvn -P build-web install -e >> > >> > >> > On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: >> >> >> >> Hello All, >> >> I am having trouble getting a profile to activate. >> >> >> >> My scenario is as follows...I have a complicated build process for >> >> making webapps that includes xdoclet and jspc. I have all the >> necessary >> >> plugins defined in a profile on parent pom. I can't define those >> >> plugins in the normal section or the install of the >> >> parent pom itself fails. >> >> >> >> I have tried two ways to activate the pom. One is to use: >> >> >> >> build-web-profile >> >> >> >> false >> >> >> >> build-web >> >> true >> >> >> >> >> >> >> >> in my parent pom. Then I set >> >> >> >> >> >> true >> >> >> >> >> >> in the child pom. Doesn't work. Doesn't show up on >> >> help:active-profiles either. I even tried adding that property to my >> >> settings.xml and still nothing. >> >> >> >> Also tried using a file activation, which also fails. I read >> somewhere >> >> that that activation is still buggy though. >> >> >> >> Anybody have any other ideas on how to do this? >> >> >> >> Thanks in advance, >> >> Ben >> >> >> >> - >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > >> > >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Profile Activation
Ah-Ha! Thank you so much. I think that is the best solution yet! Although, even better would be if maven had an additional param on in which it meant inherited, but not run. And then I wouldn't even have to put the definition there. One can dream... Thanks again, -Ben Brad Szabo wrote: Have you considered using the build/pluginManagement element to define common inheritable plugin configurations instead of using profiles? -Brad On Tue, 2007-02-27 at 14:15 -0500, Ben Tatham wrote: basically, I have a parent pom...ie a maven project with pom Each of my projects use that as the . Option one sounds interesting...do submodules have to be subdirectories? Does the top-level pom module have to be able to build on its own, because it won't in my configuration because it expects certain directories to exist that don't exist except for in the real projects. Thanks for your continuing assistance... -Ben Mick Knutson wrote: Hmm. Not sure I understand. But you can always create a master pom, and have each of your projects create a sub module on your project that way they will always extend your master pom.xml for everyone. You could also mandate that each pom.xml only have access to your remote repo not the main maven repo, thus they will only have access to the plugins you have in your repo. But that does not help with the config of the plugins. On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: between projects -- we don't use modules. and the projects are pretty separate except for the build tools required. Is it possible to make my own plugin of plugins easily...with just xml? is there another solution for this? -Ben Mick Knutson wrote: Are you trying to share plugin info between projects, or modules? On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Nope. Apparently profiles are not inherited. Excerpt from POM Reference: The elements in the parent POM that are inherited by its children are: * dependencies * developers and contributors * plugin lists * reports lists * plugin executions with matching ids * plugin configuration Not profiles. Doh. Any other suggestions on how to share plugin setups between multiple projects? Thanks, Ben Mick Knutson wrote: try mvn -P build-web install -e On 2/27/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Hello All, I am having trouble getting a profile to activate. My scenario is as follows...I have a complicated build process for making webapps that includes xdoclet and jspc. I have all the necessary plugins defined in a profile on parent pom. I can't define those plugins in the normal section or the install of the parent pom itself fails. I have tried two ways to activate the pom. One is to use: build-web-profile false build-web true in my parent pom. Then I set true in the child pom. Doesn't work. Doesn't show up on help:active-profiles either. I even tried adding that property to my settings.xml and still nothing. Also tried using a file activation, which also fails. I read somewhere that that activation is still buggy though. Anybody have any other ideas on how to do this? Thanks in advance, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mvn clean problems
I am having a problem that was reported last year, but the workaround they mentioned doesn't seem to be working. Here was the original posting: http://mail-archives.apache.org/mod_mbox/maven-dev/200603.mbox/[EMAIL PROTECTED] Basically, I am getting a java.lang.NoClassDefFoundError for org/apache/maven/shared/model/fileset/SetBase Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-clean-plugin:2.1.1-maestro-1.1:clean': Unable to find the mojo 'org.apache.maven.plugins:maven-clean-plugin:2.1.1-maestro-1.1:clean' in the plugin 'org.apache.maven.plugins:maven-clean-plugin' org/apache/maven/shared/model/fileset/SetBase The original work around was to make sure that "central" pluginRepository was not in your pom.xml. Well, its not in my case, although the help:effective-pom does have it (but I assume that comes from the Super POM). Please help. This is working for some of our team, but not for others. This problems blocks use from doing mvn release as well, because that does a mvn clean internally. Thanks in advance, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
plugin runs multiple times
Hello all, I have a scenario where my plugins (antrun, xdoclet, custom stuff) get run multiple times. I think this has something to do with some plugins forkin a new lifecycle, but I can't figure out: 1) which ones are doing that 2) good description of how to stop this from happening. I have parent poms defining some plugins, and I have pushed things around into pluginManagement instead, but this does not seem to help. -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: plugin runs multiple times
Yes, I have checked all that. Everything is declared only once in the plugins section. And the ones that are inherited from the parent pom are also declared in the pluginManagement section, but my understanding is that the pluginManagement section does not effect the current project. How do I know which plugins start a new lifecycle? Or am I totally off base... -Ben Wayne Fay wrote: Also see this page for more specific usage info for the help plugin: http://maven.apache.org/plugins/maven-help-plugin/usage.html Wayne On 3/21/07, Wayne Fay <[EMAIL PROTECTED]> wrote: Try mvn help:effective-pom in your top-level project to see what plugins map where with what configurations etc. Perhaps that will help you figure out what's going on. Wayne On 3/21/07, Ben Tatham <[EMAIL PROTECTED]> wrote: > Hello all, > I have a scenario where my plugins (antrun, xdoclet, custom stuff) get > run multiple times. I think this has something to do with some plugins > forkin a new lifecycle, but I can't figure out: > 1) which ones are doing that > 2) good description of how to stop this from happening. > > I have parent poms defining some plugins, and I have pushed things > around into pluginManagement instead, but this does not seem to help. > > -Ben > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: plugin runs multiple times
I have tracked my problem down a bit further...the second lifecycle starts sometime around the package phase in the lifecycle. I think it may have something to do with the fact that during the validate phase, I unpack parent WAR on my own using the dependency-maven-plugin so that I can extract the web.xml file and merge it with the new one (I am using xdoclet). Does the war plugin just call on dependency-maven-plugin too to do the war overlap? If so, perhaps that is what is triggering the 2nd lifecycle run from validate? Or is it something else? How do I make it stop happening?!?! A quote from "Better Builds with Maven", Section 5.3.1: "In good mojo design, determining when not to execute, is often as important as the modifications made during execution itself." Any help is appreciated. -Ben Wayne Fay wrote: Also see this page for more specific usage info for the help plugin: http://maven.apache.org/plugins/maven-help-plugin/usage.html Wayne On 3/21/07, Wayne Fay <[EMAIL PROTECTED]> wrote: Try mvn help:effective-pom in your top-level project to see what plugins map where with what configurations etc. Perhaps that will help you figure out what's going on. Wayne On 3/21/07, Ben Tatham <[EMAIL PROTECTED]> wrote: > Hello all, > I have a scenario where my plugins (antrun, xdoclet, custom stuff) get > run multiple times. I think this has something to do with some plugins > forkin a new lifecycle, but I can't figure out: > 1) which ones are doing that > 2) good description of how to stop this from happening. > > I have parent poms defining some plugins, and I have pushed things > around into pluginManagement instead, but this does not seem to help. > > -Ben > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: plugin runs multiple times
Indeed, I am using assembly:attached goal. I am using this to generate a -jar.jar of my classes so that I can depend on just the classes of the war project. Is there a way to make it not do a fork, but just make the jar for me and install/deploy it? Nothing jumps out at me from the maven-assembly-plugin site. Here is my snippet from the parent pom pluginManagement section...this parent pom is used by all my web projects. org.apache.maven.plugins maven-assembly-plugin true make-assembly package attached src/assembly/jar.xml Thanks, Ben Brian E. Fox wrote: The war doesn't use the dependency plugin (btw you should update to maven-dependency-plugin 2.0-alpha-x since it supereceeds the old mojo one). Do you have assembly:assemble bound to a phase? That forks the entire build and could cause what you see. Pasting your pom would help too. -Original Message- From: Ben Tatham [mailto:[EMAIL PROTECTED] Sent: Thursday, March 22, 2007 10:57 AM To: Maven Users List Cc: [EMAIL PROTECTED] Subject: Re: plugin runs multiple times I have tracked my problem down a bit further...the second lifecycle starts sometime around the package phase in the lifecycle. I think it may have something to do with the fact that during the validate phase, I unpack parent WAR on my own using the dependency-maven-plugin so that I can extract the web.xml file and merge it with the new one (I am using xdoclet). Does the war plugin just call on dependency-maven-plugin too to do the war overlap? If so, perhaps that is what is triggering the 2nd lifecycle run from validate? Or is it something else? How do I make it stop happening?!?! A quote from "Better Builds with Maven", Section 5.3.1: "In good mojo design, determining when not to execute, is often as important as the modifications made during execution itself." Any help is appreciated. -Ben Wayne Fay wrote: Also see this page for more specific usage info for the help plugin: http://maven.apache.org/plugins/maven-help-plugin/usage.html Wayne On 3/21/07, Wayne Fay <[EMAIL PROTECTED]> wrote: Try mvn help:effective-pom in your top-level project to see what plugins map where with what configurations etc. Perhaps that will help you figure out what's going on. Wayne On 3/21/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Hello all, I have a scenario where my plugins (antrun, xdoclet, custom stuff) get run multiple times. I think this has something to do with some plugins forkin a new lifecycle, but I can't figure out: 1) which ones are doing that 2) good description of how to stop this from happening. I have parent poms defining some plugins, and I have pushed things around into pluginManagement instead, but this does not seem to help. -Ben --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: plugin runs multiple times
I think it also might be the maven-source-plugin. The source-plugin mojos both have a @execute phase=generate-sources which I think means run that phase again. Is there a way to make it not do that when run from a pom instead of the cmd line? -Ben Brian E. Fox wrote: The war doesn't use the dependency plugin (btw you should update to maven-dependency-plugin 2.0-alpha-x since it supereceeds the old mojo one). Do you have assembly:assemble bound to a phase? That forks the entire build and could cause what you see. Pasting your pom would help too. -Original Message- From: Ben Tatham [mailto:[EMAIL PROTECTED] Sent: Thursday, March 22, 2007 10:57 AM To: Maven Users List Cc: [EMAIL PROTECTED] Subject: Re: plugin runs multiple times I have tracked my problem down a bit further...the second lifecycle starts sometime around the package phase in the lifecycle. I think it may have something to do with the fact that during the validate phase, I unpack parent WAR on my own using the dependency-maven-plugin so that I can extract the web.xml file and merge it with the new one (I am using xdoclet). Does the war plugin just call on dependency-maven-plugin too to do the war overlap? If so, perhaps that is what is triggering the 2nd lifecycle run from validate? Or is it something else? How do I make it stop happening?!?! A quote from "Better Builds with Maven", Section 5.3.1: "In good mojo design, determining when not to execute, is often as important as the modifications made during execution itself." Any help is appreciated. -Ben Wayne Fay wrote: Also see this page for more specific usage info for the help plugin: http://maven.apache.org/plugins/maven-help-plugin/usage.html Wayne On 3/21/07, Wayne Fay <[EMAIL PROTECTED]> wrote: Try mvn help:effective-pom in your top-level project to see what plugins map where with what configurations etc. Perhaps that will help you figure out what's going on. Wayne On 3/21/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Hello all, I have a scenario where my plugins (antrun, xdoclet, custom stuff) get run multiple times. I think this has something to do with some plugins forkin a new lifecycle, but I can't figure out: 1) which ones are doing that 2) good description of how to stop this from happening. I have parent poms defining some plugins, and I have pushed things around into pluginManagement instead, but this does not seem to help. -Ben --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: plugin runs multiple times
OK. I have run some test stuff just to try to figure out how this stuff works... I added this: maven-antrun-plugin false run generate-sources ** Generating Sources... to a very simple pom that inherits from my pom that has this: org.apache.maven.plugins maven-source-plugin jar test-jar I just wanted to see how often my echo comes out...well, of course it happens the first time through...: [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [echo] ** Generating Sources... [INFO] Executed tasks [INFO] [resources:resources] And then after the tests have all passed, I get the following: [INFO] [jar:jar] [INFO] Building jar: C:\work\util\BenTatham\target\util-1.0.3-SNAPSHOT.jar [INFO] Preparing source:jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [INFO] Executed tasks [INFO] [source:jar {execution: default}] [INFO] Building jar: C:\work\util\BenTatham\target\util-1.0.3-SNAPSHOT-sources.jar [INFO] Preparing source:test-jar [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation. [WARNING] Removing: test-jar from forked lifecycle, to prevent recursive invocation. [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [INFO] Executed tasks [INFO] [source:test-jar {execution: default}] [INFO] Building jar: C:\work\util\BenTatham\target\util-1.0.3-SNAPSHOT-test-sources.jar Notice that although the echo itself didn't happen, it does say it is running antrun and executing tasks. Now I am even more confused than before! Please help... -Ben Brian E. Fox wrote: The war doesn't use the dependency plugin (btw you should update to maven-dependency-plugin 2.0-alpha-x since it supereceeds the old mojo one). Do you have assembly:assemble bound to a phase? That forks the entire build and could cause what you see. Pasting your pom would help too. -Original Message----- From: Ben Tatham [mailto:[EMAIL PROTECTED] Sent: Thursday, March 22, 2007 10:57 AM To: Maven Users List Cc: [EMAIL PROTECTED] Subject: Re: plugin runs multiple times I have tracked my problem down a bit further...the second lifecycle starts sometime around the package phase in the lifecycle. I think it may have something to do with the fact that during the validate phase, I unpack parent WAR on my own using the dependency-maven-plugin so that I can extract the web.xml file and merge it with the new one (I am using xdoclet). Does the war plugin just call on dependency-maven-plugin too to do the war overlap? If so, perhaps that is what is triggering the 2nd lifecycle run from validate? Or is it something else? How do I make it stop happening?!?! A quote from "Better Builds with Maven", Section 5.3.1: "In good mojo design, determining when not to execute, is often as important as the modifications made during execution itself." Any help is appreciated. -Ben Wayne Fay wrote: Also see this page for more specific usage info for the help plugin: http://maven.apache.org/plugins/maven-help-plugin/usage.html Wayne On 3/21/07, Wayne Fay <[EMAIL PROTECTED]> wrote: Try mvn help:effective-pom in your top-level project to see what plugins map where with what configurations etc. Perhaps that will help you figure out what's going on. Wayne On 3/21/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Hello all, I have a scenario where my plugins (antrun, xdoclet, custom stuff) get run multiple times. I think this has something to do with some plugins forkin a new lifecycle, but I can't figure out: 1) which ones are doing that 2) good description of how to stop this from happening. I have parent poms defining some plugins, and I have pushed things around into pluginManagement instead, but this does not seem to help. -Ben --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTE
Re: plugin runs multiple times
Thanks for looking into it. I've been doing some reading, and according to this: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html if the @execute phase=generate-sources is specified on the Mojo (which it is in this case), you cannot stop the fork from happening. Its up to the plugin itself to check if the mojo has already been run on its own. I noticed that the dependency plugin does this with its markers directory so it knows not to unpack the dependency again. Perhaps the antrun plugin is doing this too, which is why i don't get the 2nd echo in my example. I have control over some of my plugins, but unfortunately, jspc and xdoclet, I don't, and they get run multiple times (in my realworld case). Bahhh... -Ben Brian E. Fox wrote: Assembly:attached is the correct one, but you are right, the sources one is probably doing it. I'm using sources and not having that issue. Let me look... maven-source-plugin 2.0 attach-source package jar true -Original Message----- From: Ben Tatham [mailto:[EMAIL PROTECTED] Sent: Thursday, March 22, 2007 3:13 PM To: Maven Users List Subject: Re: plugin runs multiple times I think it also might be the maven-source-plugin. The source-plugin mojos both have a @execute phase=generate-sources which I think means run that phase again. Is there a way to make it not do that when run from a pom instead of the cmd line? -Ben Brian E. Fox wrote: The war doesn't use the dependency plugin (btw you should update to maven-dependency-plugin 2.0-alpha-x since it supereceeds the old mojo one). Do you have assembly:assemble bound to a phase? That forks the entire build and could cause what you see. Pasting your pom would help too. -Original Message- From: Ben Tatham [mailto:[EMAIL PROTECTED] Sent: Thursday, March 22, 2007 10:57 AM To: Maven Users List Cc: [EMAIL PROTECTED] Subject: Re: plugin runs multiple times I have tracked my problem down a bit further...the second lifecycle starts sometime around the package phase in the lifecycle. I think it may have something to do with the fact that during the validate phase, I unpack parent WAR on my own using the dependency-maven-plugin so that I can extract the web.xml file and merge it with the new one (I am using xdoclet). Does the war plugin just call on dependency-maven-plugin too to do the war overlap? If so, perhaps that is what is triggering the 2nd lifecycle run from validate? Or is it something else? How do I make it stop happening?!?! A quote from "Better Builds with Maven", Section 5.3.1: "In good mojo design, determining when not to execute, is often as important as the modifications made during execution itself." Any help is appreciated. -Ben Wayne Fay wrote: Also see this page for more specific usage info for the help plugin: http://maven.apache.org/plugins/maven-help-plugin/usage.html Wayne On 3/21/07, Wayne Fay <[EMAIL PROTECTED]> wrote: Try mvn help:effective-pom in your top-level project to see what plugins map where with what configurations etc. Perhaps that will help you figure out what's going on. Wayne On 3/21/07, Ben Tatham <[EMAIL PROTECTED]> wrote: Hello all, I have a scenario where my plugins (antrun, xdoclet, custom stuff) get run multiple times. I think this has something to do with some plugins forkin a new lifecycle, but I can't figure out: 1) which ones are doing that 2) good description of how to stop this from happening. I have parent poms defining some plugins, and I have pushed things around into pluginManagement instead, but this does not seem to help. -Ben --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail:
Override Javac in JSPC
Hello, Does anyone know how to override the javac compiler used by jspc-maven-plugin. As best I can tell, it is using the eclipse compiler (jasper-compiler-jdt), but unfortunately I am then compiling my Java with GCJ 4.0.1 which chokes on those class files. I've tried adding a dependency on my tools.jar directly in the plugin like this: org.codehaus.mojo jspc-maven-plugin true com.sun tools 1.4.2 system ${java.home}/../lib/tools.jar jspc ... But that didn't help. Any ideas? Looking at the source cource of JspcMojo and Abstract JspcMojo nothing comes to mind...all I can think of is to monkey with the classpath to try and get tools.jar in there before jdt compiler. Please help! -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Access to servers in settings.xml
I know that it is possible to refer to the properties in the settings.xml with ${setting.X}. Is it also possible to refer to the server username and passwords? I have tried ${settings.servers.ID.username} and ${settings.ID.username} and nothing works. Thanks, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Proxied Repositories
Hello All, I am trying to use archiva on our company network to "proxy" the central repos...my understanding is that this means that if a developer runs Maven and requests an artifact from the archiva repository, that if archiva does not already have it in its own repository, it will get it from the global repo (or mirror) and put it in its repo, and give it to the local maven request. That way, the next developer that comes along does not have to go out to the net to get it. Is this correct? If this is the expected behaviour, it does not seem to work for me. Any ideas? Below is my archiva.xml. Thanks in advance, Ben /disk1/maestro-1.1/project-server/data/project-server/repository true maestro Central Managed Repository http://repo.mergere.com/maven2 maestro hourly hourly true mergere Mergere Repository Mirror http://www.ibiblio.org/maven2 maestro daily true Ibiblio Ibiblio /root/.m2/repository /disk1/maestro-1.1/project-server/data/project-server/index primrose 8080
Re: Access to servers in settings.xml
Since no one seems to have an answer to my original question, I think I have a potential work around, but not really, since it doesn't work. What I did was add a property to my default profile in settings.xml to contain my username and password for the server. And then reference that property within the settings.xml in the section. Well, that doesn't work. Does anyone know if it is possible to reference properties in settings.xml? My guess is not, but hopefully there is a way? Perhaps an external properties file (like build.properties in Ant?) Any ideas? Thanks, Ben Ben Tatham wrote: I know that it is possible to refer to the properties in the settings.xml with ${setting.X}. Is it also possible to refer to the server username and passwords? I have tried ${settings.servers.ID.username} and ${settings.ID.username} and nothing works. Thanks, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxied Repositories
Thanks, Nico but that didn't work. But I have figured out the problem...if this message/problem is found in the archives later, the solution was: I had defined in my mvn settings.xml. Take those out and just use and . -Ben nicolas de loof wrote: Your right about the "download on request" behaviour : Archiva will ask the proxied repositories for any artifact missing in the managed repository. You need to grant the "guest" user the observer role so that it can download artifacts. Maybe this is the issue you get. Nico. 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: Hello All, I am trying to use archiva on our company network to "proxy" the central repos...my understanding is that this means that if a developer runs Maven and requests an artifact from the archiva repository, that if archiva does not already have it in its own repository, it will get it from the global repo (or mirror) and put it in its repo, and give it to the local maven request. That way, the next developer that comes along does not have to go out to the net to get it. Is this correct? If this is the expected behaviour, it does not seem to work for me. Any ideas? Below is my archiva.xml. Thanks in advance, Ben /disk1/maestro-1.1 /project-server/data/project-server/repository true maestro Central Managed Repository http://repo.mergere.com/maven2 maestro hourly hourly true mergere Mergere Repository Mirror http://www.ibiblio.org/maven2 maestro daily true Ibiblio Ibiblio /root/.m2/repository /disk1/maestro-1.1 /project-server/data/project-server/index primrose 8080
Re: Proxied Repositories
Oh wait...I spoke to soon. Now it got the artifact directly from repo1.maven...That's what I don't want. Argg... Nico, does setting the guest to Observer affect how it accesses .../repository? When I go to the website and look at /repository, I get a directory listing. Is that just standard tomcat doing that or is it archiva making that page for me? -Ben nicolas de loof wrote: Your right about the "download on request" behaviour : Archiva will ask the proxied repositories for any artifact missing in the managed repository. You need to grant the "guest" user the observer role so that it can download artifacts. Maybe this is the issue you get. Nico. 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: Hello All, I am trying to use archiva on our company network to "proxy" the central repos...my understanding is that this means that if a developer runs Maven and requests an artifact from the archiva repository, that if archiva does not already have it in its own repository, it will get it from the global repo (or mirror) and put it in its repo, and give it to the local maven request. That way, the next developer that comes along does not have to go out to the net to get it. Is this correct? If this is the expected behaviour, it does not seem to work for me. Any ideas? Below is my archiva.xml. Thanks in advance, Ben /disk1/maestro-1.1 /project-server/data/project-server/repository true maestro Central Managed Repository http://repo.mergere.com/maven2 maestro hourly hourly true mergere Mergere Repository Mirror http://www.ibiblio.org/maven2 maestro daily true Ibiblio Ibiblio /root/.m2/repository /disk1/maestro-1.1 /project-server/data/project-server/index primrose 8080
Re: Maven 2.0 mirror server?
So how do you setup a proxy repo? I am trying it with archiva (actually within maestro), but am having trouble getting it working. The proxy repo doesn't get the artifact, so local maven has to go out to the net to get it...I am sure I am doing something wrong either in archiva or settings.xml... snippets of settings.xml: maestro maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository central http://penguin.nanometrics.ca:8081/repository nmx-central-mirror Mergere Mirror Repository Archiva.xml: /disk1/maestro-1.1/project-server/data/project-server/repository true maestro Central Managed Repository http://repo.mergere.com/maven2 maestro hourly hourly true mergere Mergere Repository Mirror http://www.ibiblio.org/maven2 maestro daily true Ibiblio Ibiblio /root/.m2/repository /disk1/maestro-1.1/project-server/data/project-server/index primrose 8080 Baz wrote: thanks. :) On 3/24/07, Wayne Fay <[EMAIL PROTECTED]> wrote: A mirror can be a proxy, but it doesn't have to be. And there are various reasons for implementing a mirror, but one of them is certainly to increase the speed/performance of the repository. Wayne On 3/24/07, Baz <[EMAIL PROTECTED]> wrote: > Is the main purpose of Maven 2.0 mirror server is to increase > performance of Maven 2.0 repository? Is it the same as proxy server? > > Thanks. > > B. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] /disk1/maestro-1.1/project-server/data/project-server/repository true maestro Central Managed Repository http://repo.mergere.com/maven2 maestro hourly hourly true mergere Mergere Repository Mirror http://www.ibiblio.org/maven2 maestro daily true Ibiblio Ibiblio /root/.m2/repository /disk1/maestro-1.1/project-server/data/project-server/index primrose 8080 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
assembly with docs and scripts
Does anyone know of a plugin (or standard directory layout) for user docs/manuals and startup scripts, etc. Basically, we want to be able to take our final release artifacts (uberjar) and zip it with the pdf manuals, scripts to start things up, etc. If there isn't one, I will likely write my own...which then begs the question is where do docs live? in /src/doc, /doc, somewhere else ? What about scripts for that get released? I know that /src/scripts get used a lot for "build" scripts (like ant build.xml, etc). Do released scripts/bat files go there too? Cheers, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxied Repositories
Snippets of my settings.xml: central http://penguin.nanometrics.ca:8081/repository nmx-central-mirror Mergere Mirror Repository maestro maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository nicolas de loof wrote: The browsing is rendered by archiva. What URL did you provide as miror ? 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: Oh wait...I spoke to soon. Now it got the artifact directly from repo1.maven...That's what I don't want. Argg... Nico, does setting the guest to Observer affect how it accesses .../repository? When I go to the website and look at /repository, I get a directory listing. Is that just standard tomcat doing that or is it archiva making that page for me? -Ben nicolas de loof wrote: > Your right about the "download on request" behaviour : > Archiva will ask the proxied repositories for any artifact missing in the > managed repository. > > You need to grant the "guest" user the observer role so that it can > download > artifacts. Maybe this is the issue you get. > > Nico. > > > 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: >> >> Hello All, >> I am trying to use archiva on our company network to "proxy" the central >> repos...my understanding is that this means that if a developer runs >> Maven and requests an artifact from the archiva repository, that if >> archiva does not already have it in its own repository, it will get it >> from the global repo (or mirror) and put it in its repo, and give it to >> the local maven request. That way, the next developer that comes along >> does not have to go out to the net to get it. Is this correct? >> >> If this is the expected behaviour, it does not seem to work for me. Any >> ideas? Below is my archiva.xml. >> >> Thanks in advance, >> Ben >> >> >> >> >> >> /disk1/maestro-1.1 >> /project-server/data/project-server/repository >> true >> maestro >> Central Managed Repository >> >> >> >> >> http://repo.mergere.com/maven2 >> maestro >> hourly >> hourly >> true >> mergere >> Mergere Repository Mirror >> >> >> http://www.ibiblio.org/maven2 >> maestro >> daily >> true >> Ibiblio >> Ibiblio >> >> >> /root/.m2/repository >> >> /disk1/maestro-1.1 >> /project-server/data/project-server/index >> >> primrose >> 8080 >> >> >> >> >
Re: Proxied Repositories
First of all, thank you sooo much for all your help. But no, that doesn't work. I get a 404: Resource in error: http://penguin.nanometrics.ca:8081/repository/maestro Exception details: it.could.webdav.DAVException: Not found at it.could.webdav.methods.HEAD.process(HEAD.java:52) at it.could.webdav.methods.GET.process(GET.java:58) at it.could.webdav.DAVProcessor.process(DAVProcessor.java:79) at it.could.webdav.DAVServlet.service(DAVServlet.java:198) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:666) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) I think maestro is taking away the need for that. -Ben nicolas de loof wrote: AFAIK you have to add the managed repository ID after " http://penguin.nanometrics.ca:8081/repository"; -> http://penguin.nanometrics.ca:8081/repository/myrepo 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: Snippets of my settings.xml: central http://penguin.nanometrics.ca:8081/repository nmx-central-mirror Mergere Mirror Repository maestro maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository nicolas de loof wrote: > The browsing is rendered by archiva. > > What URL did you provide as miror ? > > 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: >> >> Oh wait...I spoke to soon. Now it got the artifact directly from >> repo1.maven...That's what I don't want. Argg... >> >> Nico, does setting the guest to Observer affect how it accesses >> .../repository? When I go to the website and look at /repository, I get >> a directory listing. Is that just standard tomcat doing that or is it >> archiva making that page for me? >> >> -Ben >> >> nicolas de loof wrote: >> > Your right about the "download on request" behaviour : >> > Archiva will ask the proxied repositories for any artifact missing in >> the >> > managed repository. >> > >> > You need to grant the "guest" user the observer role so that it can >> > download >> > artifacts. Maybe this is the issue you get. >> > >> > Nico. >> > >> > >> > 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: >> >> >> >> Hello All, >> >> I am trying to use archiva on our company network to "proxy" the >> central >> >> repos...my understanding is that this means that if a developer runs >> >> Maven and requests an artifact from the archiva repository, that if >> >> archiva does not already have it in its own repository, it will >> get it >> >> from the global repo (or mirror) and put it in its repo, and give >> it to >> >> the local maven request. That way, the next developer that comes >> along >> >> does not have to go out to the net to get it. Is this correct? >> >> >> >> If this is the expected behaviour, it does not seem to work for >> me. Any >> >> ideas? Below is my archiva.xml. >> >> >> >> Thanks in advance, >> >> Ben >> >> >> >> >> >> >> >> >> >> >> >> /disk1/maestro-1.1 >> >> /project-server/data/project-server/repository >> >> true >> >> maestro >> >> Central Managed Repository >> >> >> >> >> >> >> >> >> >> http://repo.mergere.com/maven2 >> >> maestro >> >> hourly >> >> hourly >> >> true >> >> mergere >> >> Mergere Repository Mirror >> >> >> >> >> >> http://www.ibiblio.org/maven2 >> >> maestro >> >> daily >> >> true >> >> Ibiblio >> >> Ibiblio >> >> >> >> >> >> /root/.m2/repository >> >> >> >> /disk1/maestro-1.1 >> >> /project-server/data/project-server/index >> >> >> >> primrose >> >> 8080 >> >> >> >> >> >> >> >> >> > >> >> >
Re: Proxied Repositories
Ok. I took that out, but that doesn't help either. 1) Why does the warning say http://repo1.maven.org/maven2 when really it tried http://penguin... 2) Has anyone done this with maestro before? I rather avoid it, but I'm tempted to install archiva standalone to try it their... Downloading: http://penguin.nanometrics.ca:8081/repository/org/apache/ant/ant-apache-oro/1.7.0/ant-apache-oro-1.7.0.pom [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2) Downloading: http://penguin.nanometrics.ca:8081/repository/org/apache/ant/ant-apache-oro/1.7.0/ant-apache-oro-1.7.0.jar [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2) [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Failed to resolve artifact. Missing: -- 1) org.apache.ant:ant-apache-oro:jar:1.7.0 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.apache.ant -DartifactId=ant-apache-oro \ -Dversion=1.7.0 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) org.apache.maven.plugins:maven-antrun-plugin:maven-plugin:1.1 2) org.apache.ant:ant-apache-oro:jar:1.7.0 -- 1 required artifact is missing. for artifact: org.apache.maven.plugins:maven-antrun-plugin:maven-plugin:1.1 from the specified remote repositories: central (http://repo1.maven.org/maven2), snapshots (http://snapshots.maven.codehaus.org/maven2) Emmanuel Venisse wrote: You don't need the part because it's your mirror. Emmanuel nicolas de loof a écrit : AFAIK you have to add the managed repository ID after " http://penguin.nanometrics.ca:8081/repository"; -> http://penguin.nanometrics.ca:8081/repository/myrepo 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: Snippets of my settings.xml: central http://penguin.nanometrics.ca:8081/repository nmx-central-mirror Mergere Mirror Repository maestro maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository maestro-project-server Maestro Project Server http://penguin.nanometrics.ca:8081/repository nicolas de loof wrote: > The browsing is rendered by archiva. > > What URL did you provide as miror ? > > 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: >> >> Oh wait...I spoke to soon. Now it got the artifact directly from >> repo1.maven...That's what I don't want. Argg... >> >> Nico, does setting the guest to Observer affect how it accesses >> .../repository? When I go to the website and look at /repository, I get >> a directory listing. Is that just standard tomcat doing that or is it >> archiva making that page for me? >> >> -Ben >> >> nicolas de loof wrote: >> > Your right about the "download on request" behaviour : >> > Archiva will ask the proxied repositories for any artifact missing in >> the >> > managed repository. >> > >> > You need to grant the "guest" user the observer role so that it can >> > download >> > artifacts. Maybe this is the issue you get. >> > >> > Nico. >> > >> > >> > 2007/3/29, Ben Tatham <[EMAIL PROTECTED]>: >> >> >> >> Hello All, >> >> I am trying to use archiva on our company network to "proxy" the >> central >> >> repos...my understanding is that this means that if a developer runs >> >> Maven and requests an artifact from the archiva repository, that if >> >> archiva does not already have it in its own repository, it will >> get it >> >> from the global repo (or mirror) and put it in its repo, and give >> it to >> >> the local maven request. That way, the next developer that comes >> along >> >> does not have to go out to the net to get it. Is this correct? >> >> >> >> If this is the expected behaviour, it does not seem to work for >> me. Any >> >> ideas? Below is my archiva.xml. >> >> >> >> Thanks in advance, >> >> Ben >> >> >> >> >> >> >> >> >> >> >> >> /disk1/maestro-1.1 >> >> /project-server/data/project-server/repository >> >> true >> >> maestro >> >> Central Managed Repository >> >> >> >> >> >> >> >> >> >> http://repo.mergere.com/maven2 >> >> maestro >> >> hourly >> >> hourly >> >> true >> >> mergere >> >> Mergere Repository Mirror >> >> >> >> >> >> http://www.ibiblio.org/maven2 >> >> maestro >> >> daily >> >> true >> >> Ibiblio >> >> Ibiblio >> >> >> >> >> >> /root/.m2/repository >> >> >> >> /disk1/maestro-1.1 >> >> /project-server/data/project-server/index >> >> >> >> primrose >> >> 8080 >> >> >> >> >> >> >> >> >> > >> >> >
ant mojo properties
Hello all, I have noticed some weirdness in ant mojos. If you define properties in the pom.xml that get passed to the ant script through the ant mojo, then you cannot access those properties except inside of targets. In other words, if I have a property in my ant script like this at the top (not in a ): An I want to to be able to specify ${name} and ${version}, I cannot do this. I have to wait until I am inside of a to be able to refer to ${name} and ${version}. Has anyone else seen this problem? If someone else agrees, I will put it as a bug, or at least an enhancement into JIRA. -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Indexer: cannot find artifact
Hi, Whenever I run the indexer on my repository, I get a this error: Couldn't find artifact /disk1/maestro-1.1/project-server/data/project-server/repository/ca/nanometrics/apollo/core/1.0.9/core-1.0.9-test.jar If I just create that file, it works, but of course this error happens over and over for different artifacts. In fact, it happens for almost all my "war" projects...I am using the maven-jar-plugin, "test-jar" goal to make the test jar, which creates: core-1.0.9-tests-jar.jar for me. But the real question is why/how does Archiva care about them, and why can't it index them? Thanks, Ben
maven-resources-plugin
I am pulling my hair out trying to add a testResources directory with the maven-resources-plugin. I have a bunch of files in src\filesystem that I want to add as testResources, so I have the following in my pom. Nothing happens though. I have tried doing resources:testResources from the command line too. I have tried it without an "execution", and just config, but still nothing. Any ideas? Thanks, Ben maven-resources-plugin copy-my-resources testResources src/filesystem - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re-enable disabled repository
Hello all, I have seen people talking about this, but it always seems to be a different issue... I am getting "Skipping disabled repository" for our Archiva server. Why did maven "disable" it, and how do I re-enable it to make it try again? I can find no documentation on this. How is it persisting that the repo is "disabled". Please help! Thanks, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Site Distribution URL
I am having difficulty understanding how the site-deploy decides what url to use for the site deployment... I have my parent pom of all my projects set up like this: penguin Nanometrics Software Website scp://penguin/disk1/software/sites/${project.artifactId}/ But when the deploy actually happens, I get the following behaviour: 1) For the parent pom itelf (artifactId=common-pom), I get the correct directory: /disk1/software/sites/common-pom/ 2) For child projects (artifactId=range), I get /disk1/software/sites/range/range/ 3) For another project which itself a pom (artifactId=web-common-pom), it deploys to /disk1/software/sites/web-common-pom/web-common-pom/ 4) For child projects of the 2nd level parent pom (artifactId=configuration), it deploys to /disk1/software/sites/configuration/web-common-pom/configuraion/ Very strange. Any idea why the ${project.artifactId} is not working properly, or is it the site plugin doing something funny to modify the url setting? For the #2 case, it would seem that the site plugin automatically appends the artifactId to the URL, but it does not happen for the pom project itself. Not consistent at all. Thanks in advance, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
WAR Project Inheritance
Hi, A long time ago, this question was posted, but I can't find the answer (if there was one?) My primary goal is to create a WAR (don't need an EAR) that depends on another WAR project...essentially extending that original project. I want to include all the JSPs, etc from the parent WAR. Unfortunately, WAR dependencies don't get copied into the /target. Any ideas on how to extend a WAR project with another WAR project. To get the java classes, I've been making a special assembly with a -jar classified and depending on that...but I don't know how to get the JSPs. I guess I could do the same thing with a -jsp classifier, but there must be a more elegant way. Why can't you depend on a WAR? Arghh... The old reference: http://mail-archives.apache.org/mod_mbox/maven-users/200511.mbox/[EMAIL PROTECTED] -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Extracting parts of web.xml
Does anyone have any experience extracts specific tags of an xml file? I need to extract the and tags from my web.xml so that I can feed those into XDoclet WebDoclet so that I can generate a web.xml file while still preserving existing servlets. Is there a known Maven plugin (or perhaps one in Ant I can wrap into Maven) to do this? Perhaps someone knows of a simple perl script to do this? -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SCM from Parent POM
I am having an issue that I think might be related in POM inheritance. We have a company wide POM, which of course itself in our SCM system (subversion). I can't tell if I'm having a problem with subversion or with maven, but it looks like whenever I run the release:prepare, it is inheriting the tag location from the parent pom instead of looking in its own pom. And more than that, the SCM section is updating to be the parent's pom locations. Has anyone seen this behaviour before? According to the POM Reference, the SCM should not be inherited... Thanks in advance, -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Access to server settings from settings.xml
Hi, Is it possible to access a server username/password (even/especially when encrypted) from an Ant Mojo and/or antrun script? If you know how to do it from a Java Mojo, I would take that too. I would like to be able to use it to ssh to other servers where we have some cross-compilers installed, etc, and currently we are forcing our developers to set our own properties in settings.xml, which does not support encryption. I have tried things like this (following the pattern from http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide) , but of course, the server must get in there somehow, I assume. ${settings.servers.id.username} ${settings.server.id.username} etc etc to no avail. Thanks, Ben
Re: Access to server settings from settings.xml
To answer my own question for groovy, I found this: http://weblogs.java.net/blog/2009/08/10/getting-most-out-maven-settingsxml-file which explains doing this: def server = settings.servers.find{ it.id.equals('dbserver') } But does anyone know how to do it in ant? Thanks, Ben - "Ben Tatham" wrote: > Hi, > > Is it possible to access a server username/password (even/especially when > encrypted) from an Ant Mojo and/or antrun script? > > If you know how to do it from a Java Mojo, I would take that too. > > I would like to be able to use it to ssh to other servers where we have some > cross-compilers installed, etc, and currently we are forcing our developers > to set our own properties in settings.xml, which does not support encryption. > > I have tried things like this (following the pattern from > http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide) , but of > course, the server must get in there somehow, I assume. > ${settings.servers.id.username} ${settings.server.id.username} etc etc to no > avail. > > Thanks, > Ben
Defining Custom Default Lifecycle
We are trying to define out own custom default lifecycle, but we would like to define some of our phase names. Is this possible? Looking at http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-custom-lifecycle.html and http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-override-default-lifecycle.html, the best we can figure out is to define our own lifecycle, and then fork it from the default lifecycle at a given phase. This would still require us to override (as empty) all the other phases of the default lifecycle and still spawns a new maven process. Is this even possible? -Ben
Maven3 and artifact resolution in maven-inherit-plugin
I am trying to use the org.ops4j:maven-inherit-plugin:1.1, which has always worked great for me in Maven2. But now I am using Maven3, and I get this error: [ERROR] Failed to execute goal org.ops4j:maven-inherit-plugin:1.1:inherit (default) on project helios-product-package-plugin: assembly plugin is not a dependency -> [Help 1] Switching back to Maven 2.2.1 makes the error go away. I debugged and stepped through the plugin and determined that the issue is that Maven3 has not yet resolved the file to the Artifact, even though the plugin does specify @requiresDependencyResolution compile. (I have created a patch to the plugin itself to do to the resolve using ArtifactRepository (local.repository), ArtifactFactory, and ArtifactResolver) Basically, what the plugin is trying to do is check for any dependency with the type maven-plugin, which it does find, but then checks that the Artifact.getFile() is not null. My fix of forcing the resolve of it Has anyone else run into this issue with this or other plugins? Is there another workaround in Maven3 itself? Is this a known regression? -Ben Cross-posted to the gene...@lists.ops4j.org (the list for, among other things, maven-inherit-plugin) -- Ben Tatham Software Developer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca
depending on project classes in plugin
Hi, I have a plugin that depends on the classes in the project from where the plugin is called. Is there a way to add the un-installed classes (ie add target/classes) to the classpath of the plugin at runtime? Normally, you would do this by adding a to the plugin definition in the pom, but since the project itself has not been released yet, this is not possible. Currently, I release the project, release the plugin with updated dependency, and then re-release the project again. I am hoping a for a single run of the project build, and no need to rebuild the plugin each time. Perhaps a multi-module build would help here... Thanks, Ben
Run plugin during release on all modules
I have a custom plugin that I run on all our projects as part of the release:perform goal. We are just starting to use multi-module builds, and I notice that my plugin only runs at the top module. What do I have to do to my plugin to make it run on all the modules individually at the end of the release? Do I have to iterate through them in the plugin code itself? If so, is there an example of doing that, because from what I see, MavenProject.getModules() just returns a list of String names of those modules. I've tried with and without @aggregator, but that doesn't change anything with respect to my problem. Any advice on this issue would be very helpful... Thanks, -- Ben Tatham
resources in an ant plugin
Hello, I have a maven plugin, written in ant. I want to include resources in it that I can then use during the run of the plugin. If it were a java mojo, I could get the resource directly out of the classpath (from the jar). But in an ant plugin...I have no idea. But how can I do this? I have been using the maven-dependency-plugin to to get it from some other artifact, but that is very messy...I want it all self-contained in the same plugin. Looking at the maven-ant-tasks, it doesn't seem that easy to do the equivalent (even on "myself", ie the plugin itself). Any ideas? Thanks in advance, Ben PS If you want details... Specifically, I have a makefile that I need to use in multiple other projects, and I want to put it in the plugin. I then copy to a remote build machine, and call make remotely on it. Its for an embedded java enviroment (with gcj). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
inherit verifications file
In the maven-verifier-plugin, is it possible to inherit a verifications file from a parent pom, without having to unpack the parent pom as a dependency in the child pom explicitly? I wish I could just define verification rules inside the of the plugin in the parent pom, and then this problem would be avoided. This same issue applies top maven-assembly-plugin. -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NoSuchMethod analysis
Does anyone know of a maven plugin that will analyze dependencies and verify that all jars are compatible? This would catch NoSuchMethod errors from being thrown later...the best case is that all of these will be caught in junit...but not always since the unit tests will only cover the top level project, and not the nested libraries. For example, imagine you have a Project, call it A. A depends on X and Y libraries directly. X also depends on Y directly. "A" depends on X 2.0 and Y2.0. However, if X 2.0 was released while depending on Y 1.0, and some method in Y changed its signature between 1.0 and 2.0, then when A runs, and some class in X tries to call the changed signature in Y, it will get NoSuchMethod -- only at runtime. Without requiring that we always release Y, then X, then A, we would like to be able to catch these runtime errors at compile time...It should be a fairly simple check of all the class files against the current classpath, and I'm hoping that something has already been written to do this...perhaps even built in to javac somewhere, or some other JDK tool? Or some existing maven plugin. Thanks for reading and trying to understand this hard-to-explain, yet fairly obvious problem. -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
release scm changes
Is there a way in the release plugin to have it not change the scm urls? Or at least put them back as they were on the trunk? I want the trunk to keep the urls of the trunk, instead of changing it to tags/project-version everytime. And this change seems to be inconsistent. Does anyone else see this odd behaviour? I am using SVN (of course). -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: release scm changes
Perhaps it is failing the release then, which explains the periodic nature of "tags" being left in the scm urls. Shouldn't release:clean supposed to clean this up? Or is that what release:rollback is for? Do you know since what version release:rollback has been available? I tried it a while back, and even though its documented in the maven site, it didn't exist yet. -Ben Dennis Lundberg wrote: Ben Tatham wrote: Is there a way in the release plugin to have it not change the scm urls? Or at least put them back as they were on the trunk? I want the trunk to keep the urls of the trunk, instead of changing it to tags/project-version everytime. And this change seems to be inconsistent. Does anyone else see this odd behaviour? I am using SVN (of course). -Ben What the release plugin does is this: - Change the scm urls in pom.xml on trunk - Tag the trunk (= svn copy) - Change the scm urls in pom.xml on trunk back to how they were before the tagging occured How is that not working for you? Please supply some configuration and version info. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
plugin site documentation
I am trying to get my custom plugin to generate the nice summary of goals and parameters for the web site. I have tried adding plugin:report and plugin:xdoc to the pom, during the site phase. The xml gets generated, but not into the site. Anyone have any ideas? Shouldn't plugin:report be a standard run on maven-plugin packaging? Thanks, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
war libraries scope
Does anyone know what scope is used to bring jars in the WEB-INF/lib directory of a war? It appears to bring in all scope=compile dependencies. Shouldn't this be just runtime dependencies? For example, I am precompiling all my JSPs, so I don't need jasper-compiler library. According to dependency:tree, its compile scope. But its still in my WEB-INF lib. And because of it, so is ant-1.6.5.jar Any ideas how to get rid of these? Thanks, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: plugin site documentation
Is this supposed to work for ant-mojos as well? Dennis Lundberg wrote: Ben Tatham wrote: I am trying to get my custom plugin to generate the nice summary of goals and parameters for the web site. I have tried adding plugin:report and plugin:xdoc to the pom, during the site phase. The xml gets generated, but not into the site. Anyone have any ideas? Shouldn't plugin:report be a standard run on maven-plugin packaging? Thanks, Ben You just need to include the plugin plugin in the pom of your plugin like this: org.apache.maven.plugins maven-plugin-plugin The run 'mvn site' - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: custom lifecycle without inheritance
Hello, I am trying to invoke a single goal before another (ant-based) Mojo executes. Due to http://jira.codehaus.org/browse/MNG-5405 I cannot just do foo:bar in the mojo.xml for the plugin. So instead, I've defined a lifecycle.xml, with only one goal in it. This works fine as a workaround for now, except that the forked lifecycle inherits the goals from the lifecycle of the project that is running the mojo in the first place. In some of our projects, we have a lot of custom mojos running, even in the initialize phase. So...is there a way to: a) define a new phase name (I don't think so) or b) make it so that the lifecycle.xml only runs what is defined there and does not inherit the project's lifecycle? -- Ben Tatham Software Developer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca -- Ben Tatham Software Developer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca
build extension in reactor
Hi all, Is it possible to define a custom lifecycle (build extension) in a plugin that is in the same reactor as a project that uses that lifecycle? From what I can tell, the answer is no, but perhaps I am missing something subtle that would allow it to work. Imagine a project like this: foo-parent - foo-lifecycle-plugin (defines components.xml with foo-product) - foo - foo-product foo-lifecycle-plugin ${project.parent.version} true Seems like even mvn validate won't run from the top of the reactor: [ERROR] Unresolveable build extension: Plugin ca.nanometrics.apollo:foo-lifecycle-plugin:4.0.0-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for ca.nanometrics.apollo:foo-lifecycle-plugin:jar:4.0.0-SNAPSHOT @ [ERROR] Unknown packaging: foo-product @ ca.nanometrics.apollo:foo:[unknown-version], C:\work\git\products_apollo-server\foo\pom.xml, line 10, column 14 @ I can get it to work if I do the following, but obviously that is not ideal to have to manually do the reactor like that. mvn install -N # builds the parent mvn install -f foo-lifecycle-plugin # build just the plugin mvn install # build everything - (could also just build -pl :foo) -- -- Ben Tatham Software Architect *Nano**metrics* *Inc.* Ottawa * I* Calgary *I* Houston *I* Beijing T: +1 613 505 5065 *I* bentat...@nanometrics.ca www.nanometrics.ca *I *www.microseismicmonitoring.com This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, or have been inadvertently and erroneously referenced in the address line, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
Re: Structuring bigger Maven projects
I am happy to see this discussion, and so many responses. We have struggled with it for years, and never found a great solution. Sounds like we do what many others are doing: - We have many shared internal libraries amount multiple products. - We divide each logical set of libraries into their own repos, often multi-module builds themselves. - Each product is in its own repo as well, also often a multi-module build depending on the complexity of the product. We aren't a huge team, despite the number 4-6 products we have, but basically any team can make a change to a library as needed. We do have Pull Requests that are visible to the whole dev team, and we try to maintain some consistency at the library level, but that is a separate discussion. We then have a policy that whenever a PR is merged into a "library", we "release" that "library". We just jgitflow <https://bitbucket.org/atlassian/jgit-flow/wiki/Home> for releasing because, well obviously, we use git flow. It is up to the product teams to update their versions for internal libraries. As others have mentioned, we use versions plugin for that. We always keep our versions in properties so we can use mvn versions:update-properties. We configured it to only update our "internal" repositories by default so that we can quickly do that without worry of bring in some 3rd party/OSS update without vetting it first.This is done with shared corporate parent pom configuration com.yourcompany*:* jetty.version,servlet-api.version,${moreExcludeProperties> Note the extra ${moreExcludeProperties> at the end, which allows child poms to add to the list through another property in their own pom as needed. We also automatically build our products every night with the latest of all the internal libraries. While a bit delayed, at least we get a notification if another teams' update of a library will break a separate product - either compile or test. In the old days of subversion, we used to actually automatically update all the poms in our repo whenever we did a release - without a CI server. That was automated through a plugin that scanned all the pom's in the svn repo for use of the released library and auto-updated and commited the new version. If not familiar with svn, you can picture each top-level directory of svn being converted to a git repo (in a svn "repo" meant something different than git, at least practically speaking). This was nice because the author of the library change was the "author" of all the pom updates, and thus easy to "blame"/"praise" for a break (or fix) and because it was an instantaneous update, so CI would run immediately on all the dependent projects. That was possible because with SVN you could do commits without having to actually clone a local copy. With git spread across multiple repos it would require all our devs to have all git repos checked out in a consistent fashion to make this scalable -- so not something we've preserved when we switch to git years ago. Alternatively, we would have to auto-clone all the known repos in our system -- again, not really scalable. Food for thought -- it's great to hear so many other ways of dealing with this problem. -Ben On Thu, Dec 1, 2016 at 8:57 AM Christian Schulte wrote: > Am 12/01/16 um 10:02 schrieb João Cabrita: > > [...] > > > Each of the applications live in a separate repository > > [...] > > > The libraries also have a repository each > > [...] > > That's due to the SCM in use. Yes. This is something to keep in mind as > well. What can be one (big) repository using subversion, may need to be > split into multiple (tons) of repositories when switching to e.g. git. > Basing something on a concept introduced by the SCM in use will make it > hard to switch to another technology later. Subversion on the server and > git-svn locally is working great here. Commits to the subversion server > are really clean because developers could re-arrange theire commits > (rebase -i, squash, etc.) locally before. Depending on the subversion > revision for anything you'll not change to another SCM technology ever > soon (why would you?). > > > ----- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > -- -- Ben Tatham Software Architect *Nano**metrics* *Inc.* Ottawa * I* Calgary *I* Houston *I* Beijing T: +1 613 505 5065 *I* bentat...@nanometrics.ca www.nanometrics.ca *I *www.microseismicmonitoring.com This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally e
uber source jar
Is there a well-known way to create an uber source jar? In other words, a jar of all the source code for a project and all its dependencies (or at least those that have a -sources.jar)? I've looked into doing it with the maven-assembly-plugin, but using a dependencySet with includes of *.*.*.sources.* doesn't work because those are not actually dependencies of the project. I perhaps could look into using dependency:sources, and specifying an alternate repository to download them into (in target, eg), and then use a fileSet of maven-assembly-plugin to add them all, but there must be a better way... Thanks, Ben -- -- Ben Tatham Software Architect *Nano**metrics* *Inc.* Ottawa * I* Calgary *I* Houston *I* Beijing T: +1 613 505 5065 *I* bentat...@nanometrics.ca www.nanometrics.ca *I *www.microseismicmonitoring.com This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, or have been inadvertently and erroneously referenced in the address line, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
Re: uber source jar
jarjar doesn't have that option as far as I can tell... What I did find was this in the maven-dependency-plugin: https://maven.apache.org/plugins/maven-dependency-plugin/examples/using-dependencies-sources.html So if I do that, and then run a maven-assembly-plugin referencing the unpacked files, I can do it in two steps. ${project.build.directory}/sources . And then I get my uber source jar... In theory, I could wrap this up in my own plugin using mojo-executor to make it single step, and single declaration in my pom. Or write something that does it all in a custom plugin natively.If I were to do that, not sure if it would belong in maven-sources-plugin or maven-dependency-plugin to which I could contribute. Thanks everyone for trying. On Wed, Mar 8, 2017 at 9:03 PM M. Justin wrote: > I haven't used it myself, but there is this maven plugin > <https://sonatype.github.io/jarjar-maven-plugin/> for JarJar Links. > > On Wed, Mar 8, 2017 at 4:34 PM, Curtis Rueden wrote: > > > Hi Ben, > > > > > Is there a well-known way to create an uber source jar? In other > > > words, a jar of all the source code for a project and all its > > > dependencies (or at least those that have a -sources.jar)? > > > > Good question. The way I have done it is to explicitly enumerate all the > > sources classifier JARs in a profile [1]. This is of course very yucky, > and > > I would love to know if there is a better way. > > > > I definitely suggest you avoid uber-JARs (with or without embedded > sources) > > when possible, though; for a rationale, see http://imagej.net/Uber-JAR. > > > > Regards, > > Curtis > > > > [1] https://github.com/imagej/imagej/blob/imagej-2.0.0-rc- > > 59/pom.xml#L395-L626 > > > > -- > > Curtis Rueden > > LOCI software architect - https://loci.wisc.edu/software > > ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden > > > > > > On Wed, Mar 8, 2017 at 4:05 PM, Ben Tatham > > wrote: > > > > > Is there a well-known way to create an uber source jar? In other > words, a > > > jar of all the source code for a project and all its dependencies (or > at > > > least those that have a -sources.jar)? > > > > > > I've looked into doing it with the maven-assembly-plugin, but using a > > > dependencySet with includes of *.*.*.sources.* doesn't work because > those > > > are not actually dependencies of the project. > > > > > > I perhaps could look into using dependency:sources, and specifying an > > > alternate repository to download them into (in target, eg), and then > use > > a > > > fileSet of maven-assembly-plugin to add them all, but there must be a > > > better way... > > > > > > Thanks, > > > Ben > > > -- > > > -- > > > Ben Tatham > > > Software Architect > > > > > > *Nano**metrics* *Inc.* > > > > > > Ottawa * I* Calgary *I* Houston *I* Beijing > > > > > > T: +1 613 505 5065 <(613)%20505-5065> *I* bentat...@nanometrics.ca > > > www.nanometrics.ca *I *www.microseismicmonitoring.com > > > > > > This message is intended exclusively for the individual or entity to > > which > > > it is addressed. This communication may contain information that is > > > proprietary, privileged, confidential or otherwise legally exempt from > > > disclosure. If you are not the named addressee, or have been > > inadvertently > > > and erroneously referenced in the address line, you are not authorized > to > > > read, print, retain, copy or disseminate this message or any part of > it. > > If > > > you have received this message in error, please notify the sender > > > immediately by e-mail and delete all copies of the message. > > > > > > -- -- Ben Tatham Software Architect *Nano**metrics* *Inc.* Ottawa * I* Calgary *I* Houston *I* Beijing T: +1 613 505 5065 *I* bentat...@nanometrics.ca www.nanometrics.ca *I *www.microseismicmonitoring.com This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, or have been inadvertently and erroneously referenced in the address line, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
Re: uber source jar
For those who find this post in the future, you can also use the maven-shade-plugin to create an uber-source jar, but it also creates an potentially unwanted binder jar too... see http://stackoverflow.com/questions/42683048/how-do-i-create-an-uber-source-jar-with-maven for details. On Thu, Mar 9, 2017 at 10:55 AM Ben Tatham wrote: > jarjar doesn't have that option as far as I can tell... > > What I did find was this in the maven-dependency-plugin: > https://maven.apache.org/plugins/maven-dependency-plugin/examples/using-dependencies-sources.html > > So if I do that, and then run a maven-assembly-plugin referencing the > unpacked files, I can do it in two steps. > > > ${project.build.directory}/sources > . > > > And then I get my uber source jar... > > In theory, I could wrap this up in my own plugin using mojo-executor to > make it single step, and single declaration in my pom. Or write something > that does it all in a custom plugin natively.If I were to do that, not > sure if it would belong in maven-sources-plugin or maven-dependency-plugin > to which I could contribute. > > Thanks everyone for trying. > > > On Wed, Mar 8, 2017 at 9:03 PM M. Justin wrote: > > I haven't used it myself, but there is this maven plugin > <https://sonatype.github.io/jarjar-maven-plugin/> for JarJar Links. > > On Wed, Mar 8, 2017 at 4:34 PM, Curtis Rueden wrote: > > > Hi Ben, > > > > > Is there a well-known way to create an uber source jar? In other > > > words, a jar of all the source code for a project and all its > > > dependencies (or at least those that have a -sources.jar)? > > > > Good question. The way I have done it is to explicitly enumerate all the > > sources classifier JARs in a profile [1]. This is of course very yucky, > and > > I would love to know if there is a better way. > > > > I definitely suggest you avoid uber-JARs (with or without embedded > sources) > > when possible, though; for a rationale, see http://imagej.net/Uber-JAR. > > > > Regards, > > Curtis > > > > [1] https://github.com/imagej/imagej/blob/imagej-2.0.0-rc- > > 59/pom.xml#L395-L626 > > > > -- > > Curtis Rueden > > LOCI software architect - https://loci.wisc.edu/software > > ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden > > > > > > On Wed, Mar 8, 2017 at 4:05 PM, Ben Tatham > > wrote: > > > > > Is there a well-known way to create an uber source jar? In other > words, a > > > jar of all the source code for a project and all its dependencies (or > at > > > least those that have a -sources.jar)? > > > > > > I've looked into doing it with the maven-assembly-plugin, but using a > > > dependencySet with includes of *.*.*.sources.* doesn't work because > those > > > are not actually dependencies of the project. > > > > > > I perhaps could look into using dependency:sources, and specifying an > > > alternate repository to download them into (in target, eg), and then > use > > a > > > fileSet of maven-assembly-plugin to add them all, but there must be a > > > better way... > > > > > > Thanks, > > > Ben > > > -- > > > -- > > > Ben Tatham > > > Software Architect > > > > > > *Nano**metrics* *Inc.* > > > > > > Ottawa * I* Calgary *I* Houston *I* Beijing > > > > > > T: +1 613 505 5065 <(613)%20505-5065> *I* bentat...@nanometrics.ca > > > www.nanometrics.ca *I *www.microseismicmonitoring.com > > > > > > This message is intended exclusively for the individual or entity to > > which > > > it is addressed. This communication may contain information that is > > > proprietary, privileged, confidential or otherwise legally exempt from > > > disclosure. If you are not the named addressee, or have been > > inadvertently > > > and erroneously referenced in the address line, you are not authorized > to > > > read, print, retain, copy or disseminate this message or any part of > it. > > If > > > you have received this message in error, please notify the sender > > > immediately by e-mail and delete all copies of the message. > > > > > > > -- > -- > Ben Tatham > Software Architect > > *Nano**metrics* *Inc.* > > Ottawa * I* Calgary *I* Houston *I* Beijing > > T: +1 613 505 5065 *I* bentat...@nanometrics.ca > www.nanometrics.ca *I *www.microseismicmonitoring.com > > This message is inten
Re: maven release plugin
Sounds like you're using gitflow (master, develop, feature/* branches). If so, we use the jgitflow-maven-plugin instead of maven-release-plugin, which handles these transitions and the inherent conflicts caused by the maven versioning. Unfortunately, the maintainer is no longer working on it (and says he's not even working in java anymore), but it still works well. https://bitbucket.org/atlassian/jgit-flow/wiki/Home On Wed, Feb 28, 2018 at 7:18 AM Matthew Broadhead < matthew.broadh...@nbmlaw.co.uk> wrote: > hi, > not sure if this is the correct place to ask questions about the maven > release plugin > i am trying to set my snapshots and releases properly > i am using git with a master branch and a development branch > how do i work in the snapshot on development and then tag the releases > to master? > if you know any good tutorials online that would help as i tried a few > but they didn't fit my case > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > -- -- Ben Tatham Software Architect *Nano**metrics* *Inc.* Ottawa * I* Calgary *I* Houston *I* Beijing T: +1 613 505 5065 *I* bentat...@nanometrics.ca www.nanometrics.ca *I *www.microseismicmonitoring.com This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, or have been inadvertently and erroneously referenced in the address line, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
Defining component by hint for plexus in pom.xml
Hi, I'm trying to do some pretty advanced things with custom plugins with @Components. Basically, I want to use the same mojo with slight variations, and I want to be able to inject those variations via the pom (or via the perhaps as well). The plugin already defines a custom lifecycle, so I am ok if I have to define that lifecycle twice, I just don't want to have to define the 12+ mojos twice for almost the exact same thing. Essentially, I have a mojo that define a @Component: @Component Parser parser; I then I have two implementations of that Parser interface: @Component(role=Parser.class, hint="simple") public class SimpleParser implements Parser and @Component(role=Parser.class, hint="complex") public class ComplexParser implements Parser I know that on the mojo itself, could tell the mojo which one to use (by setting it like this: @Component(hint = "complex") but what I really want is to force the user to define the hint in the pom or command line. But as far as I can tell, there is no way to do this. Is there a way around this other than making two separate mojos, which then defeats the purpose of using plexus at all here as far as I can tell, because I may as well just define the implementation explicitly (albeit, plexus would still be useful for test code, I suppose). Can I use an expression for the hint, and perhaps pass that as a separate parameter somehow? Any help or suggestions would be appreciated. -Ben -- Ben Tatham Sr. Software Engineer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca
How to run a plugin across all modules during release:perform
Hi, We have a custom plugin that runs whenever we release a project. Most of our projects are _not_ multi-module, so it generally works fine by adding that plugin to the release-plugin . However, when I add that into the root pom of a multi-module build, it only runs on the top-level project, even though the modules inherit from that pom and do declare maven-release-plugin so in theory, it should pick up that configuration. Is there a way to force the plugin to run in each module during release? I've explored options on the plugin itself [1] and options on the maven-release-plugin[2] , but can't find anything about this issue. Specifically, our plugin goes through our scm repository and updates the dependencies in all our designated pom's to the newly released version of the project being released - so we also want the module projects to get updated in our repository. Thanks, Ben [1] http://maven.apache.org/developers/mojo-api-specification.html [2] http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html -- Ben Tatham Software Developer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca
Re: How to run a plugin across all modules during release:perform
I agree that there are many ways to solve the problem of updating libraries in various projects. I had this discussion a few years back with John Casey and Tim O'Brien, although coming at it from a different angle. http://getsatisfaction.com/sonatype/topics/how_do_i_layout_subversion_with_multi_module_builds The pom-updater does run after deploy, as part of the release:perform goals, so there is no issue with un-deployed artifacts being referenced. We are a relatively small company, and don't need/want the extra overhead of doing Nexus staging of each of our shared libraries (we have a lot of shared libraries among a few top-level products). In any case, none of that has to do with the question itself (although I agree at stepping back to look at the big picture as well). So, even if I run my plugin after release is complete, I still need it to run on all the modules. That is the root of my question: how do I make the plugin do that? It sounds like @aggregator is the answer, so I'll try that. -Ben On Wed, Dec 7, 2011 at 10:09 AM, Anders Hammar wrote: > I don't think that you approach is good. If you want it to happen > together with release:perform, it MUST happen after deploy as the > deploy to the repo could fail. If that fails, you mustn't update any > project depending on it as it doesn't exist in the repo. Also, if > you're using some kind of staging (like in Nexus Pro), you simply > can't do this update until the artifact has been promoted/released. > > Also, your comment about updating "module projects" in your repo. I > assume you're talking about the artifacts in the maven repo? They must > never be changed, so don't do this! > > If I were you, I would perform this update dependencies as a > completely separate activity after the release has been fully > completed. Including staging and whatever it would include. Everything > doesn't have to be bound to the Maven build. Some things are more > appropriate to perform as a separate step. > > /Anders > On Wed, Dec 7, 2011 at 15:41, Ben Tatham wrote: > > Hi, > > We have a custom plugin that runs whenever we release a project. Most of > > our projects are _not_ multi-module, so it generally works fine by adding > > that plugin to the release-plugin . However, when I add that into > > the root pom of a multi-module build, it only runs on the top-level > > project, even though the modules inherit from that pom and do declare > > maven-release-plugin so in theory, it should pick up that configuration. > > > > Is there a way to force the plugin to run in each module during release? > > I've explored options on the plugin itself [1] and options on the > > maven-release-plugin[2] , but can't find anything about this issue. > > > > Specifically, our plugin goes through our scm repository and updates the > > dependencies in all our designated pom's to the newly released version of > > the project being released - so we also want the module projects to get > > updated in our repository. > > > > Thanks, > > Ben > > > > [1] http://maven.apache.org/developers/mojo-api-specification.html > > [2] > http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html > > > > -- > > Ben Tatham > > Software Developer > > Nanometrics Inc. > > +1 613-592-6776 x254 > > http://www.nanometrics.ca > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > -- Ben Tatham Software Developer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca
Re: How to run a plugin across all modules during release:perform
@aggregator does not do what I need. The plugin still only runs on the top-level module.Am I missing something incredibly obvious about the core of maven multi-module builds? >mvn ca.nanometrics.maven:nmx-pom-plugin:1.5.5-SNAPSHOT:parent [INFO] Scanning for projects... [INFO] [INFO] Reactor Build Order: [INFO] [INFO] nmx-pom [INFO] common-pom [INFO] common-pom-java6 [INFO] common-pom-libgcj [INFO] web-common-pom [INFO] web-common-pom-java6 [INFO] web-common-pom-libgcj [INFO] galileo-common-pom [INFO] [INFO] [INFO] Building nmx-pom 4.1.14 [INFO] [INFO] [INFO] --- nmx-pom-plugin:1.5.5-SNAPSHOT:parent (default-cli) @ nmx-pom --- ... [INFO] [INFO] Reactor Summary: [INFO] [INFO] nmx-pom ... SUCCESS [27.467s] [INFO] common-pom SKIPPED [INFO] common-pom-java6 .. SKIPPED [INFO] common-pom-libgcj . SKIPPED [INFO] web-common-pom SKIPPED [INFO] web-common-pom-java6 .. SKIPPED [INFO] web-common-pom-libgcj . SKIPPED [INFO] galileo-common-pom SKIPPED [INFO] [INFO] BUILD SUCCESS [INFO] [INFO] Total time: 27.934s [INFO] Finished at: Wed Dec 07 11:34:48 EST 2011 [INFO] Final Memory: 5M/245M [INFO] On Wed, Dec 7, 2011 at 11:16 AM, Ben Tatham wrote: > I agree that there are many ways to solve the problem of updating > libraries in various projects. I had this discussion a few years back with > John Casey and Tim O'Brien, although coming at it from a different angle. > > > http://getsatisfaction.com/sonatype/topics/how_do_i_layout_subversion_with_multi_module_builds > > The pom-updater does run after deploy, as part of the release:perform > goals, so there is no issue with un-deployed artifacts being referenced. > We are a relatively small company, and don't need/want the extra overhead > of doing Nexus staging of each of our shared libraries (we have a lot of > shared libraries among a few top-level products). > > In any case, none of that has to do with the question itself (although I > agree at stepping back to look at the big picture as well). > > So, even if I run my plugin after release is complete, I still need it to > run on all the modules. That is the root of my question: how do I make > the plugin do that? It sounds like @aggregator is the answer, so I'll try > that. > > -Ben > > > On Wed, Dec 7, 2011 at 10:09 AM, Anders Hammar wrote: > >> I don't think that you approach is good. If you want it to happen >> together with release:perform, it MUST happen after deploy as the >> deploy to the repo could fail. If that fails, you mustn't update any >> project depending on it as it doesn't exist in the repo. Also, if >> you're using some kind of staging (like in Nexus Pro), you simply >> can't do this update until the artifact has been promoted/released. >> >> Also, your comment about updating "module projects" in your repo. I >> assume you're talking about the artifacts in the maven repo? They must >> never be changed, so don't do this! >> >> If I were you, I would perform this update dependencies as a >> completely separate activity after the release has been fully >> completed. Including staging and whatever it would include. Everything >> doesn't have to be bound to the Maven build. Some things are more >> appropriate to perform as a separate step. >> >> /Anders >> On Wed, Dec 7, 2011 at 15:41, Ben Tatham >> wrote: >> > Hi, >> > We have a custom plugin that runs whenever we release a project. Most >> of >> > our projects are _not_ multi-module, so it generally works fine by >> adding >> > that plugin to the release-plugin . However, when I add that >> into >> > the root pom of a multi-module build, it only runs on the top-level >> > project, even though the modules inherit from that pom and do declare >> > maven-release-plugin so in theory, it should pick up that configuration. >> > >> > Is there a way to force the plugin to run in each module during release? >> >
Aggregate changelog of dependencies
We are looking into an automated way to get a changelog of all our libraries between releases. Clearly, the maven-changelog-plugin is great for that on an individual project (perhaps coupled with maven-changes-plugin, if only it supported a Bugzilla report...). Has there ever been any talk of deploying the changelog as a separate artifact so that a dependent project can include those changes in its own changelog? Our company has many internal libraries that are shared across many projects (hence most are not multi-module monoliths where a single changelog is possible). For our purposes, we would likely only want to have a changelog of our internal dependencies (easy to filter based on groupId). Would anyone else be interested in such a feature, if we were to implement it either as a submission to the maven-changelog-plugin or as a separate plugin? The trick, of course, is keeping track of what dependency versions have changed, and handling that multiple versions of a library may have been released in between a release of the top-level project. I imagine getting the previous release pom from Nexus, parsing the dependency versions, and then fetching all the changelogs for those intermediate versions. I suspect most projects do this sort of thing by using the maven-changes-plugin and each bug being cross-listed, if it affects multiple projects. And new features are also listed as issues, which are completed in a version as well. So perhaps that is the direction we should head, but I thought I would ask about changelog's too. -Ben -- Ben Tatham Software Developer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca
Re: [ANN] plan-maven-plugin v1.1 released
Very cool, indeed. With all the hype around Maven 3 having a built the execution plan up front, I was surprised this feature wasn't included in the maven-help-plugin (like effective-pom and effective-settings) or even in mvn itself. Perhaps you could port this feature to be a patch to the maven-help-plugin. -Ben On Wed, May 9, 2012 at 2:52 PM, Carlo Sciolla wrote: > Hi, > > Thanks for the feedback! > > 2012/5/9 Karl Heinz Marbaise > > > Hi, > > > > I would also strongly suggest using a Maven Site as that's IMHO common > >> practice for plugins. Makes it easy to find info as all plugin sites > >> are structured the same. > >> > > definitely good way.. > > ok, I'll work on a proper Maven site next. > > > > .furthermore what exactly does the plugin print out ? What about a > example > > output ? > > > It's indeed missing in the site and only available on the GitHub README. > Here's how it looks like: > > $ mvn plan:plan clean javadoc:javadoc package install site:site > [...] > [INFO] --- plan-maven-plugin:1.1:plan (default-cli) @ plan-maven-plugin --- > [INFO] > [INFO] Current lifecycle: > [INFO] pre-clean > [INFO] clean > [INFO] post-clean > [INFO] validate > [INFO] initialize > [INFO] generate-sources > [INFO] process-sources > [INFO] generate-resources > [INFO] process-resources > [INFO] compile > [INFO] process-classes > [INFO] generate-test-sources > [INFO] process-test-sources > [INFO] generate-test-resources > [INFO] process-test-resources > [INFO] test-compile > [INFO] process-test-classes > [INFO] test > [INFO] prepare-package > [INFO] package > [INFO] pre-integration-test > [INFO] integration-test > [INFO] post-integration-test > [INFO] verify > [INFO] install > [INFO] deploy > [INFO] > [INFO] Execution plan: > [INFO] [-] tk.skuro:plan-maven-plugin:plan (default-cli) > [INFO] [clean] org.apache.maven.plugins:maven-clean-plugin:clean > (default-clean) > [INFO] [-] org.apache.maven.plugins:maven-javadoc-plugin:javadoc > (default-cli) > [INFO] [validate] > org.apache.maven.plugins:maven-enforcer-plugin:enforce (enforce-maven) > [INFO] [generate-resources] > org.apache.maven.plugins:maven-plugin-plugin:descriptor > (default-descriptor) > [INFO] [process-resources] > org.apache.maven.plugins:maven-resources-plugin:resources > (default-resources) > [INFO] [compile] > org.apache.maven.plugins:maven-compiler-plugin:compile > (default-compile) > [INFO] [process-test-resources] > org.apache.maven.plugins:maven-resources-plugin:testResources > (default-testResources) > [INFO] [test-compile] > org.apache.maven.plugins:maven-compiler-plugin:testCompile > (default-testCompile) > [INFO] [test] org.apache.maven.plugins:maven-surefire-plugin:test > (default-test) > [INFO] [package] org.apache.maven.plugins:maven-jar-plugin:jar > (default-jar) > [INFO] [package] > org.apache.maven.plugins:maven-plugin-plugin:addPluginArtifactMetadata > (default-addPluginArtifactMetadata) > [INFO] [validate] > org.apache.maven.plugins:maven-enforcer-plugin:enforce (enforce-maven) > [INFO] [generate-resources] > org.apache.maven.plugins:maven-plugin-plugin:descriptor > (default-descriptor) > [INFO] [process-resources] > org.apache.maven.plugins:maven-resources-plugin:resources > (default-resources) > [INFO] [compile] > org.apache.maven.plugins:maven-compiler-plugin:compile > (default-compile) > [INFO] [process-test-resources] > org.apache.maven.plugins:maven-resources-plugin:testResources > (default-testResources) > [INFO] [test-compile] > org.apache.maven.plugins:maven-compiler-plugin:testCompile > (default-testCompile) > [INFO] [test] org.apache.maven.plugins:maven-surefire-plugin:test > (default-test) > [INFO] [package] org.apache.maven.plugins:maven-jar-plugin:jar > (default-jar) > [INFO] [package] > org.apache.maven.plugins:maven-plugin-plugin:addPluginArtifactMetadata > (default-addPluginArtifactMetadata) > [INFO] [install] > org.apache.maven.plugins:maven-install-plugin:install > (default-install) > [INFO] [-] org.apache.maven.plugins:maven-site-plugin:site > (default-cli) > [INFO] > > > HTH, > c. > > -- > Carlo Sciolla > > --==(A)==-- > Linux User #372086 > My personal blog: http://www.skuro.tk > Follow me on twitter: http://twitter.com/skuro > <http://twitter.com/skuro>Fork me on Github: http://github.com/skuro > <http://github.com/skuro>My LinkedIn profile: > http://nl.linkedin.com/in/carlosciolla > --==(A)==-- > > Product Lead at Backbase - Next Generation Portal Software for Financials & > Large Enterprises (http://www.backbase.com) > -- Ben Tatham Software Developer Nanometrics Inc. +1 613-592-6776 x254 http://www.nanometrics.ca
maven-build-cache: extra attached directories output of target
Hello, Is it possible to add extra attached directories that are not within the project build output directory (ie not in ./target?) Based on the documentation and playing around with attachedOutputs <https://maven.apache.org/extensions/maven-build-cache-extension/build-cache-config.html#class_attachedOutputs>, those are relative to the project output directory (target). I want to preserve those, but also want to preserve a secondary directory with it. (In our case, we are doing an angular build as part of the project, which outputs into ./dist that we want to reload from the cache as well. Thanks, Ben [image: -] <http://www.nanometrics.ca> [image: -] <https://twitter.com/nanometricsinc> [image: -] <https://www.linkedin.com/company/nanometrics-seismological-instruments/> [image: -] <https://www.youtube.com/channel/UCwao286g87g7Mqj6qvnLIZw> Ben Tatham Principal Software Developer Nanometrics bentat...@nanometrics.ca -- This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, or have been inadvertently and erroneously referenced in the address line, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
maven-build-cache, immutable docker tags, etc
Hi, I'm loving the ideas in the maven-build-cache, but I'm running into some circular build issues that are blocking us from using it at the moment. In many of our projects, we deploy docker images. Ideally, we would like to keep our docker images immutable. To achieve that, we have extra maven plugins that create unique SNAPSHOT version numbers (based on jira issue ids, git commit hashes, and/our CI build numbers). We do this for docker image immutability, but also to avoid SNAPSHOT collisions when multiple developers are working at the same time in the same project, but still be able to deploy the snapshot artifacts for other reasons (temporary test deployments, sharing libraries as snapshots while still in development across projects, etc). But that solution creates unique maven versions in CI for every build, which of course then contradicts using maven-build-cache, since the version is always different in CI. To use maven-build-cache, we would just go back to using standard -SNAPSHOT builds, but then we have to solve our original issues a different way. (Sadly, AWS ECR only allows setting immutability at the registry level. I looked at nexus as a docker registry, and it seems to be even higher at the whole docker repo level. (We wish we could set immutability of images based on the tag - ie allow -SNAPSHOT tags to mutable, but nothing else)) One idea we have is to use a different docker registry for snapshot vs release builds, but since maven properties are evaluated at the beginning of the maven lifecycle, we cannot change the parameters sent to maven plugins that due to the docker builds once the build starts. Thus, we would have to do something outside of maven to detect, eg, if the build is a snapshot and choose a different docker registry there and pass it on the command line. We would love this to be an all-maven solution. Does anyone else run into similar issues with maven-build-cache? Is there some weird way we can ignore the project.version altogether on the maven-build-cache (that seems very odd, for sure though)? Other ideas? Thanks, Ben [image: -] <http://www.nanometrics.ca> [image: -] <https://twitter.com/nanometricsinc> [image: -] <https://www.linkedin.com/company/nanometrics-seismological-instruments/> [image: -] <https://www.youtube.com/channel/UCwao286g87g7Mqj6qvnLIZw> Ben Tatham Principal Software Developer Nanometrics bentat...@nanometrics.ca -- This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, or have been inadvertently and erroneously referenced in the address line, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.
Re: maven-build-cache, immutable docker tags, etc
Thanks, Francois. That would have been great for our original problem, but how I can I leverage that for build cache issues? On Sun, Sept 24, 2023, 5:14 a.m. Francois Marot wrote: > Just a suggestion: you could use ci-friendly Maven to pass in a version > depending on the commit Id/sha1 on the command line. Like mvn > -Drevision= > More info: > https://maven.apache.org/maven-ci-friendly.html > > Regards > > Le jeu. 21 sept. 2023, 15:49, Ben Tatham .invalid> > a écrit : > > > Hi, > > I'm loving the ideas in the maven-build-cache, but I'm running into some > > circular build issues that are blocking us from using it at the moment. > > > > In many of our projects, we deploy docker images. Ideally, we would like > to > > keep our docker images immutable. To achieve that, we have extra maven > > plugins that create unique SNAPSHOT version numbers (based on jira issue > > ids, git commit hashes, and/our CI build numbers). We do this for docker > > image immutability, but also to avoid SNAPSHOT collisions when multiple > > developers are working at the same time in the same project, but still be > > able to deploy the snapshot artifacts for other reasons (temporary test > > deployments, sharing libraries as snapshots while still in development > > across projects, etc). > > > > But that solution creates unique maven versions in CI for every build, > > which of course then contradicts using maven-build-cache, since the > version > > is always different in CI. > > > > To use maven-build-cache, we would just go back to using standard > -SNAPSHOT > > builds, but then we have to solve our original issues a different way. > > > > (Sadly, AWS ECR only allows setting immutability at the registry level. I > > looked at nexus as a docker registry, and it seems to be even higher at > the > > whole docker repo level. (We wish we could set immutability of images > based > > on the tag - ie allow -SNAPSHOT tags to mutable, but nothing else)) > > > > One idea we have is to use a different docker registry for snapshot vs > > release builds, but since maven properties are evaluated at the beginning > > of the maven lifecycle, we cannot change the parameters sent to maven > > plugins that due to the docker builds once the build starts. Thus, we > would > > have to do something outside of maven to detect, eg, if the build is a > > snapshot and choose a different docker registry there and pass it on the > > command line. We would love this to be an all-maven solution. > > > > Does anyone else run into similar issues with maven-build-cache? Is > there > > some weird way we can ignore the project.version altogether on the > > maven-build-cache (that seems very odd, for sure though)? Other ideas? > > > > Thanks, > > > > Ben > > > > [image: -] <http://www.nanometrics.ca> > > [image: -] <https://twitter.com/nanometricsinc> [image: -] > > <https://www.linkedin.com/company/nanometrics-seismological-instruments/ > > > > [image: > > -] <https://www.youtube.com/channel/UCwao286g87g7Mqj6qvnLIZw> > > > > Ben Tatham > > Principal Software Developer > > Nanometrics > > bentat...@nanometrics.ca > > > > -- > > This message is intended exclusively for the individual or entity to > which > > it is addressed. This communication may contain information that is > > proprietary, privileged, confidential or otherwise legally exempt from > > disclosure. If you are not the named addressee, or have been > inadvertently > > and erroneously referenced in the address line, you are not authorized to > > read, print, retain, copy or disseminate this message or any part of it. > > If > > you have received this message in error, please notify the sender > > immediately by e-mail and delete all copies of the message. > > > -- This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, or have been inadvertently and erroneously referenced in the address line, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.