You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steven Crosley <st...@mac.com> on 2009/02/11 17:52:49 UTC

Running a plugin from the pom

I'm trying to run the yui-compressor maven plugin found here:

http://alchim.sourceforge.net/yuicompressor-maven-plugin/index.html

It runs fine when I run it by itself:
$> mvn net.sf.alchim:yuicompressor-maven-plugin:compress
But when I add it to the pom.xml and run:
mvn package
it doesn't run but should be executed at the process-resources phase.   
Maybe I am not understanding the build process enough, but I thought  
if you run package, it would automatically run the process-resources  
phase, here is the plugin that I added to my pom.

		<plugin>
			<groupId>net.sf.alchim</groupId>
			<artifactId>yuicompressor-maven-plugin</artifactId>
			<executions>
			  <execution>
				<goals>
					<goal>compress</goal>
				</goals>
			  </execution>
			</executions>
			<configuration>
			  <nosuffix>true</nosuffix>
			  <aggregations>
				<aggregation>
				  <!-- remove files after aggregation (default: false)
				  <removeIncluded>true</removeIncluded>
				  -->
				  <!-- insert new line after each concatenation (default: false) -->
				  <insertNewLine>true</insertNewLine>
				  <output>${project.build.directory}/${project.build.finalName}/js/ 
compressed/all.js</output>
				  <!-- files to include, path relative to output's directory or  
absolute path-->
				  <includes>
					<include>**/*.js</include>
				  </includes>
				  <!-- files to exclude, path relative to output's directory
				  <excludes>
					<exclude>**/*.pack.js</exclude>
					<exclude>**/compressed.css</exclude>
				  </excludes>
				  -->
				</aggregation>
			  </aggregations>
			</configuration>
       </plugin>



Re: Running a plugin from the pom

Posted by Wayne Fay <wa...@gmail.com>.
> Doesn't look like that worked, do I also need to run this 'compress' goal in
> my mvn command? I would like to avoid that if possible.

I don't use this plugin myself. You're probably better off contacting
the plugin developers directly (or a corresponding user list) to get
more specific help.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Running a plugin from the pom

Posted by Steven Crosley <st...@mac.com>.
Doesn't look like that worked, do I also need to run this 'compress'  
goal in my mvn command? I would like to avoid that if possible.

Thanks,
Steven

On Feb 11, 2009, at 11:58 AM, Wayne Fay wrote:

>>                       <executions>
>>                         <execution>
>                                 <phase>package</phase>
>>                               <goals>
>>                                       <goal>compress</goal>
>
> You're missing a <phase> node which tells Maven when to run the goal
> in that plugin. I added it to your XML -- try that.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Running a plugin from the pom

Posted by Wayne Fay <wa...@gmail.com>.
>                        <executions>
>                          <execution>
                                 <phase>package</phase>
>                                <goals>
>                                        <goal>compress</goal>

You're missing a <phase> node which tells Maven when to run the goal
in that plugin. I added it to your XML -- try that.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org