Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
Are you using a recent version of Maven? Once upon a time the inheritence flag didn't work. FWIW you can also define inherit=false on an execution On Thu, May 13, 2010 at 9:53 AM, Shan Syed wrote: > Thanks, but the problem is that when I do that, both executions occur, even > when I specify inheritance=false. > > I basically need to use the same plugin for two different purposes, without > either of them affecting the other; I tried to specify different versions > for the mvn dep plugin (i.e. in one block, specify 2.0, and 2.1 for the > other), but no dice. > > Running mvn help:effective-pom on my WAR projects always shows the second > maven-dependency-plugin configuration from the root POM in the > pluginManagement section > BUT > in the actual plugin block, it shows the following (below) > (note the second execution, with not configuration or anything associated > with it) > > What is the exact logic for the merging of plugin configs in a multimodule > project? > > thanks > > S > > > maven-dependency-plugin > 2.1 > > > unpack-wsdls > generate-resources > > unpack > > > > C:\dev\sk\sk-saml\sk-saml-web\sk-saml-server\target/war/WEB-INF/wsdl > > > > unpack-javascripts > > > > > > sk-javascript-token > com.securekey.javascript > 1.0-SNAPSHOT > javascript > zip > > > > > > On Thu, May 13, 2010 at 4:54 AM, Kalpak Gadre wrote: > >> I have never tried declaring the same plugin twice, but you can simply >> define more executions in the same plugin declaration like, >> >> >> >> one >> . >> . >> >> >> two >> . >> . >> >> >> >> >> Thanks, >> >> Kalpak >> >> >> Here's my scenario: I have a large multimodule project whose WARs share >>> certain dependencies, which are packaged as zips by a few simple >>> assemblies >>> I wrote. >>> >>> I am using the maven-dependency-plugin to unpack the contents of these >>> zips >>> into their destination folders in the webapps. >>> >>> However, to reduce clutter and minimize maintenance, the majority of the >>> plugin configuration is in the root POM, like so: >>> (note that I am using the same plugin twice for two different reasons - is >>> this valid?) >>> >>> >>> >>> >>> ... >>> >>> >>> org.apache.maven.plugins >>> maven-dependency-plugin >>> true >>> >>> >>> unpack-javascripts >>> >>> unpack >>> >>> package >>> >>> >>> ${project.build.directory}/war/scripts >>> >>> >>> >>> >>> >>> >>> org.apache.maven.plugins >>> maven-dependency-plugin >>> true >>> >>> >>> unpack-wsdls >>> >>> unpack >>> >>> generate-resources >>> >>> >>> >>> ${project.build.directory}/war/WEB-INF/wsdl >>> >>> >>> >>> >>> >>> >>> >>> >>> Some WARs need the WSDLs, some need the javascript files, while others >>> don't >>> need either - it will be up to the developers creating those projects. >>> >>> Here is an example usage in one of the WARs (note the ID of the execution, >>> which is expected to be used to merge the whole configuration) >>> >>> >>> >>> >>> maven-dependency-plugin >>> org.apache.maven.plugins >>> true >>> >>> >>> unpack-javascripts >>> >>> >>> >>> >>> >>> >>> sk-javascript-token >>> >>> com.securekey.javascript >>> ${project.version} >>> javascript >>> zip >>> >>> >>> >>> >>> >>> >>> >>> So in general, the plugin confi
Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
Try this. In your WAR POM remove all the maven-dependency-plugin and put this in true maven-dependency-plugin org.apache.maven.plugins sk-javascript-token com.securekey.javascript ${project.version} javascript zip In your Parent POM remove the current section and put this in. unpacking-WSDL unpack-WSDL true org.apache.maven.plugins maven-dependency-plugin 2.1 true unpack-wsdls unpack generate-resources ${project.build.directory}/war/WEB-INF/wsdl unpacking-javascript unpack-javascript true org.apache.maven.plugins maven-dependency-plugin 2.1 false unpack-javascripts unpack package ${project.build.directory}/war/scripts Tim McGinnis 717 720-1962 Web Development AES/PHEAA From: "Shan Syed" To: "Maven Users List" Date: 05/13/2010 01:22 PM Subject: Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions I tried this (in my WAR POM): org.apache.maven.plugins maven-dependency-plugin unpacking-javascript true maven-dependency-plugin org.apache.maven.plugins unpack-javascripts sk-javascript-token com.securekey.javascript ${project.version} javascript zip parent POM: unpacking-WSDL org.apache.maven.plugins maven-dependency-plugin 2.1 true unpack-wsdls unpack generate-resources ${project.build.directory}/war/WEB-INF/wsdl unpacking-javascript
Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
I tried this (in my WAR POM): org.apache.maven.plugins maven-dependency-plugin unpacking-javascript true maven-dependency-plugin org.apache.maven.plugins unpack-javascripts sk-javascript-token com.securekey.javascript ${project.version} javascript zip parent POM: unpacking-WSDL org.apache.maven.plugins maven-dependency-plugin 2.1 true unpack-wsdls unpack generate-resources ${project.build.directory}/war/WEB-INF/wsdl unpacking-javascript org.apache.maven.plugins maven-dependency-plugin 2.1 false unpack-javascripts unpack package ${project.build.directory}/war/scripts still no effect, even though the maven-dependency-plugin is now mentioned twice in the WAR's POM.. hmm, do I have to do the same in the parent POM? i.e. specify the plugin in the build's plugin management? \ On Thu, May 13, 2010 at 1:08 PM, Timothy Mcginnis wrote: > Are you defining the plugin in your WAR POM also? Using the > pluginManagement I believe you also need to call out the use of the plugin > in the WAR POM, but don't define any of the execution/configuration data, > that is provided by the pluginManagement in the profile. > > > Profile provides this: > > > > ... > > > org.apache.maven.plugins > maven-dependency-plugin > true > > > unpack-javascripts > > unpack > > package > > ${project.build.directory}/war/scripts > > > > > > > > WAR POM specifies this: > > > > > > org.apache.maven.plugins > maven-dependency-plugin > > > > > > > Tim McGinnis > 717 720-1962 > Web Development > AES/PHEAA > > > > From: > "Shan Syed" > To: > "Maven Users List" > Date: > 05/13/2010 12:51 PM > Subject: > Re: inheriting and reusing the same plugin for different purposes? doesn't > seem to find the right executions > > > > thanks - how would I set this up? > I tried to specify two profiles in my parent POM, each with their own > pluginManagement blocks, containing a maven-dependency-plugin > configuration, > and then activated the profile in the WAR projects' POMs, but there is no > result > > I basically want my plugins' meta config stored in the root, and specific > configs applied in the WAR projects > > > > On Thu, May 13, 2010 at 10:26 AM, Timothy Mcginnis > wrote: > > > What about using profiles?
Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
Are you defining the plugin in your WAR POM also? Using the pluginManagement I believe you also need to call out the use of the plugin in the WAR POM, but don't define any of the execution/configuration data, that is provided by the pluginManagement in the profile. Profile provides this: ... org.apache.maven.plugins maven-dependency-plugin true unpack-javascripts unpack package ${project.build.directory}/war/scripts WAR POM specifies this: org.apache.maven.plugins maven-dependency-plugin Tim McGinnis 717 720-1962 Web Development AES/PHEAA From: "Shan Syed" To: "Maven Users List" Date: 05/13/2010 12:51 PM Subject: Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions thanks - how would I set this up? I tried to specify two profiles in my parent POM, each with their own pluginManagement blocks, containing a maven-dependency-plugin configuration, and then activated the profile in the WAR projects' POMs, but there is no result I basically want my plugins' meta config stored in the root, and specific configs applied in the WAR projects On Thu, May 13, 2010 at 10:26 AM, Timothy Mcginnis wrote: > What about using profiles? Define 3 profiles; one for wsdl only, one for > javascript only, and one for both. Then have the war project activate the > one it needs. > > Tim McGinnis > 717 720-1962 > Web Development > AES/PHEAA > > > > From: > "Shan Syed" > To: > "Maven Users List" , kalpa...@gmail.com > Date: > 05/13/2010 09:54 AM > Subject: > Re: inheriting and reusing the same plugin for different purposes? doesn't > seem to find the right executions > > > > Thanks, but the problem is that when I do that, both executions occur, > even > when I specify inheritance=false. > > I basically need to use the same plugin for two different purposes, > without > either of them affecting the other; I tried to specify different versions > for the mvn dep plugin (i.e. in one block, specify 2.0, and 2.1 for the > other), but no dice. > > Running mvn help:effective-pom on my WAR projects always shows the second > maven-dependency-plugin configuration from the root POM in the > pluginManagement section > BUT > in the actual plugin block, it shows the following (below) > (note the second execution, with not configuration or anything associated > with it) > > What is the exact logic for the merging of plugin configs in a multimodule > project? > > thanks > > S > > > maven-dependency-plugin > 2.1 > > > unpack-wsdls > generate-resources > > unpack > > > > > C:\dev\sk\sk-saml\sk-saml-web\sk-saml-server\target/war/WEB-INF/wsdl > > > > unpack-javascripts > > > > > > sk-javascript-token > com.securekey.javascript > 1.0-SNAPSHOT > javascript > zip > > > > > > On Thu, May 13, 2010 at 4:54 AM, Kalpak Gadre wrote: > > > I have never tried declaring the same plugin twice, but you can simply > > define more executions in the same plugin declaration like, > > > > > > > > one > > . > > . > > > > > > two > > . > > . > > > > > > > > > > Thanks, > > > > Kalpak > > > > > > Here's my scenario: I have a large multimodule project whose WARs share > >> certain dependencies, which are packaged as zips by a few simple > >> assemblies > >> I wrote. > >> > >> I am using the maven-dependency-plugin to unpack the contents of these > >> zips > >> into their destination folders in the webapps. > >> > >> However, to reduce clutter and minimize maintenance, the majority of > the > >> plugin configuration is in the root POM, like so: > >> (note that I am using the same plugin twice for two different reasons - > is > >> this valid?) > >> > >> > >> > >> > >> ... > >> > >> > >> org.apache.maven.plugins > >> maven-dependency-plugin > >> true > >> >
Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
thanks - how would I set this up? I tried to specify two profiles in my parent POM, each with their own pluginManagement blocks, containing a maven-dependency-plugin configuration, and then activated the profile in the WAR projects' POMs, but there is no result I basically want my plugins' meta config stored in the root, and specific configs applied in the WAR projects On Thu, May 13, 2010 at 10:26 AM, Timothy Mcginnis wrote: > What about using profiles? Define 3 profiles; one for wsdl only, one for > javascript only, and one for both. Then have the war project activate the > one it needs. > > Tim McGinnis > 717 720-1962 > Web Development > AES/PHEAA > > > > From: > "Shan Syed" > To: > "Maven Users List" , kalpa...@gmail.com > Date: > 05/13/2010 09:54 AM > Subject: > Re: inheriting and reusing the same plugin for different purposes? doesn't > seem to find the right executions > > > > Thanks, but the problem is that when I do that, both executions occur, > even > when I specify inheritance=false. > > I basically need to use the same plugin for two different purposes, > without > either of them affecting the other; I tried to specify different versions > for the mvn dep plugin (i.e. in one block, specify 2.0, and 2.1 for the > other), but no dice. > > Running mvn help:effective-pom on my WAR projects always shows the second > maven-dependency-plugin configuration from the root POM in the > pluginManagement section > BUT > in the actual plugin block, it shows the following (below) > (note the second execution, with not configuration or anything associated > with it) > > What is the exact logic for the merging of plugin configs in a multimodule > project? > > thanks > > S > > > maven-dependency-plugin > 2.1 > > > unpack-wsdls > generate-resources > > unpack > > > > > C:\dev\sk\sk-saml\sk-saml-web\sk-saml-server\target/war/WEB-INF/wsdl > > > > unpack-javascripts > > > > > > sk-javascript-token > com.securekey.javascript > 1.0-SNAPSHOT > javascript > zip > > > > > > On Thu, May 13, 2010 at 4:54 AM, Kalpak Gadre wrote: > > > I have never tried declaring the same plugin twice, but you can simply > > define more executions in the same plugin declaration like, > > > > > > > > one > > . > > . > > > > > > two > > . > > . > > > > > > > > > > Thanks, > > > > Kalpak > > > > > > Here's my scenario: I have a large multimodule project whose WARs share > >> certain dependencies, which are packaged as zips by a few simple > >> assemblies > >> I wrote. > >> > >> I am using the maven-dependency-plugin to unpack the contents of these > >> zips > >> into their destination folders in the webapps. > >> > >> However, to reduce clutter and minimize maintenance, the majority of > the > >> plugin configuration is in the root POM, like so: > >> (note that I am using the same plugin twice for two different reasons - > is > >> this valid?) > >> > >> > >> > >> > >> ... > >> > >> > >> org.apache.maven.plugins > >> maven-dependency-plugin > >> true > >> > >> > >>unpack-javascripts > >> > >> unpack > >> > >>package > >> > >> > >> > ${project.build.directory}/war/scripts > >> > >> > >> > >> > >> > >> > >> org.apache.maven.plugins > >> maven-dependency-plugin > >> true > >> > >> > >>
Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
What about using profiles? Define 3 profiles; one for wsdl only, one for javascript only, and one for both. Then have the war project activate the one it needs. Tim McGinnis 717 720-1962 Web Development AES/PHEAA From: "Shan Syed" To: "Maven Users List" , kalpa...@gmail.com Date: 05/13/2010 09:54 AM Subject: Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions Thanks, but the problem is that when I do that, both executions occur, even when I specify inheritance=false. I basically need to use the same plugin for two different purposes, without either of them affecting the other; I tried to specify different versions for the mvn dep plugin (i.e. in one block, specify 2.0, and 2.1 for the other), but no dice. Running mvn help:effective-pom on my WAR projects always shows the second maven-dependency-plugin configuration from the root POM in the pluginManagement section BUT in the actual plugin block, it shows the following (below) (note the second execution, with not configuration or anything associated with it) What is the exact logic for the merging of plugin configs in a multimodule project? thanks S maven-dependency-plugin 2.1 unpack-wsdls generate-resources unpack C:\dev\sk\sk-saml\sk-saml-web\sk-saml-server\target/war/WEB-INF/wsdl unpack-javascripts sk-javascript-token com.securekey.javascript 1.0-SNAPSHOT javascript zip On Thu, May 13, 2010 at 4:54 AM, Kalpak Gadre wrote: > I have never tried declaring the same plugin twice, but you can simply > define more executions in the same plugin declaration like, > > > > one > . > . > > > two > . > . > > > > > Thanks, > > Kalpak > > > Here's my scenario: I have a large multimodule project whose WARs share >> certain dependencies, which are packaged as zips by a few simple >> assemblies >> I wrote. >> >> I am using the maven-dependency-plugin to unpack the contents of these >> zips >> into their destination folders in the webapps. >> >> However, to reduce clutter and minimize maintenance, the majority of the >> plugin configuration is in the root POM, like so: >> (note that I am using the same plugin twice for two different reasons - is >> this valid?) >> >> >> >> >> ... >> >> >> org.apache.maven.plugins >> maven-dependency-plugin >> true >> >> >>unpack-javascripts >> >> unpack >> >>package >> >> >> ${project.build.directory}/war/scripts >> >> >> >> >> >> >> org.apache.maven.plugins >> maven-dependency-plugin >> true >> >> >>unpack-wsdls >> >> unpack >> >>generate-resources >> >> >> >> ${project.build.directory}/war/WEB-INF/wsdl >> >> >> >> >> >> >> >> >> Some WARs need the WSDLs, some need the javascript files, while others >> don't >> need either - it will be up to the developers creating those projects. >> >> Here is an example usage in one of the WARs (note the ID of the execution, >> which is expected to be used to merge the whole configuration) >> >> >> >> >> maven-dependency-plugin >> org.apache.maven.plugins >> true >> >> >>
Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
Thanks, but the problem is that when I do that, both executions occur, even when I specify inheritance=false. I basically need to use the same plugin for two different purposes, without either of them affecting the other; I tried to specify different versions for the mvn dep plugin (i.e. in one block, specify 2.0, and 2.1 for the other), but no dice. Running mvn help:effective-pom on my WAR projects always shows the second maven-dependency-plugin configuration from the root POM in the pluginManagement section BUT in the actual plugin block, it shows the following (below) (note the second execution, with not configuration or anything associated with it) What is the exact logic for the merging of plugin configs in a multimodule project? thanks S maven-dependency-plugin 2.1 unpack-wsdls generate-resources unpack C:\dev\sk\sk-saml\sk-saml-web\sk-saml-server\target/war/WEB-INF/wsdl unpack-javascripts sk-javascript-token com.securekey.javascript 1.0-SNAPSHOT javascript zip On Thu, May 13, 2010 at 4:54 AM, Kalpak Gadre wrote: > I have never tried declaring the same plugin twice, but you can simply > define more executions in the same plugin declaration like, > > > > one > . > . > > > two > . > . > > > > > Thanks, > > Kalpak > > > Here's my scenario: I have a large multimodule project whose WARs share >> certain dependencies, which are packaged as zips by a few simple >> assemblies >> I wrote. >> >> I am using the maven-dependency-plugin to unpack the contents of these >> zips >> into their destination folders in the webapps. >> >> However, to reduce clutter and minimize maintenance, the majority of the >> plugin configuration is in the root POM, like so: >> (note that I am using the same plugin twice for two different reasons - is >> this valid?) >> >> >> >> >> ... >> >> >> org.apache.maven.plugins >> maven-dependency-plugin >> true >> >> >>unpack-javascripts >> >> unpack >> >>package >> >> >> ${project.build.directory}/war/scripts >> >> >> >> >> >> >> org.apache.maven.plugins >> maven-dependency-plugin >> true >> >> >>unpack-wsdls >> >> unpack >> >>generate-resources >> >> >> >> ${project.build.directory}/war/WEB-INF/wsdl >> >> >> >> >> >> >> >> >> Some WARs need the WSDLs, some need the javascript files, while others >> don't >> need either - it will be up to the developers creating those projects. >> >> Here is an example usage in one of the WARs (note the ID of the execution, >> which is expected to be used to merge the whole configuration) >> >> >> >> >> maven-dependency-plugin >> org.apache.maven.plugins >> true >> >> >> unpack-javascripts >> >> >> >> >> >> >> sk-javascript-token >> >> com.securekey.javascript >>${project.version} >>javascript >>zip >> >> >> >> >> >> >> >> So in general, the plugin configuration in the root POM will enforce some >> common things (destination folder, etc), and the usage will actually allow >> the developer to select what javascripts they need, without worrying about >> other configuration details. >> >> But the problem is when building, it's always the 2nd plugin configuration >> in the root POM that gets used, even though I specify the ID in the leaf >> POMs;
Re: inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
I have never tried declaring the same plugin twice, but you can simply define more executions in the same plugin declaration like, one . . two . . Thanks, Kalpak Here's my scenario: I have a large multimodule project whose WARs share certain dependencies, which are packaged as zips by a few simple assemblies I wrote. I am using the maven-dependency-plugin to unpack the contents of these zips into their destination folders in the webapps. However, to reduce clutter and minimize maintenance, the majority of the plugin configuration is in the root POM, like so: (note that I am using the same plugin twice for two different reasons - is this valid?) ... org.apache.maven.plugins maven-dependency-plugin true unpack-javascripts unpack package ${project.build.directory}/war/scripts org.apache.maven.plugins maven-dependency-plugin true unpack-wsdls unpack generate-resources ${project.build.directory}/war/WEB-INF/wsdl Some WARs need the WSDLs, some need the javascript files, while others don't need either - it will be up to the developers creating those projects. Here is an example usage in one of the WARs (note the ID of the execution, which is expected to be used to merge the whole configuration) maven-dependency-plugin org.apache.maven.plugins true unpack-javascripts sk-javascript-token com.securekey.javascript ${project.version} javascript zip So in general, the plugin configuration in the root POM will enforce some common things (destination folder, etc), and the usage will actually allow the developer to select what javascripts they need, without worrying about other configuration details. But the problem is when building, it's always the 2nd plugin configuration in the root POM that gets used, even though I specify the ID in the leaf POMs; so when I do an overall build, all the javascript files end up in a WSDL directory, even if I don't reference the WSDL execution at all. I inverse the order, and the result is the opposite; the javascripts end up in the right place, but all the WARs that have a WSDL dependency end up with a "scripts" directory full of WSDL files. I was under the impression that the ID is used to merge the configurations upon building the project, but I'm not seeing this. Is there a way to specify exactly what configuration to bind to? Specify two executions within the same causes the same behaviour, except with both folders. To generalize, in a multi-module project, how can I use the same plugin for totally different uses/scenarios? thanks, Shan - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
inheriting and reusing the same plugin for different purposes? doesn't seem to find the right executions
Here's my scenario: I have a large multimodule project whose WARs share certain dependencies, which are packaged as zips by a few simple assemblies I wrote. I am using the maven-dependency-plugin to unpack the contents of these zips into their destination folders in the webapps. However, to reduce clutter and minimize maintenance, the majority of the plugin configuration is in the root POM, like so: (note that I am using the same plugin twice for two different reasons - is this valid?) ... org.apache.maven.plugins maven-dependency-plugin true unpack-javascripts unpack package ${project.build.directory}/war/scripts org.apache.maven.plugins maven-dependency-plugin true unpack-wsdls unpack generate-resources ${project.build.directory}/war/WEB-INF/wsdl Some WARs need the WSDLs, some need the javascript files, while others don't need either - it will be up to the developers creating those projects. Here is an example usage in one of the WARs (note the ID of the execution, which is expected to be used to merge the whole configuration) maven-dependency-plugin org.apache.maven.plugins true unpack-javascripts sk-javascript-token com.securekey.javascript ${project.version} javascript zip So in general, the plugin configuration in the root POM will enforce some common things (destination folder, etc), and the usage will actually allow the developer to select what javascripts they need, without worrying about other configuration details. But the problem is when building, it's always the 2nd plugin configuration in the root POM that gets used, even though I specify the ID in the leaf POMs; so when I do an overall build, all the javascript files end up in a WSDL directory, even if I don't reference the WSDL execution at all. I inverse the order, and the result is the opposite; the javascripts end up in the right place, but all the WARs that have a WSDL dependency end up with a "scripts" directory full of WSDL files. I was under the impression that the ID is used to merge the configurations upon building the project, but I'm not seeing this. Is there a way to specify exactly what configuration to bind to? Specify two executions within the same causes the same behaviour, except with both folders. To generalize, in a multi-module project, how can I use the same plugin for totally different uses/scenarios? thanks, Shan