You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matthew Hindle <ma...@gmail.com> on 2008/11/20 17:08:38 UTC

override maven-compiler-plugin?

Hi, I'm trying to override the default maven compiler with
aspectj-maven-plugin. But it insists on compiling.

My compiler settings are:


	org.codehaus.mojo
	aspectj-maven-plugin
	1.1-alpha
	
		1.6
		1.6
		1.6
		true
		warning
                      	src/main/aspect
		true
	
	
		
			org.aspectj
			aspectjrt
			1.6.1
		
	
		org.aspectj
		aspectjtools
		1.6.1
	
	
	
	         
	               compile
	                compile
	                
	                        	compile
	                
	          
	          
	                 test-compile
	                  test-compile
	                   
			test-compile
	                   
	          
           


I have even tried to exclude compiled classes with:

 
	maven-compiler-plugin 
	
		
			**/*.*
		
	
 

This still tries to compile the test cases.

Many Thanks,
Matt.
-- 
View this message in context: http://n2.nabble.com/override-maven-compiler-plugin--tp1557710p1557710.html
Sent from the maven users mailing list archive at Nabble.com.


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


Re: override maven-compiler-plugin?

Posted by Matthew Hindle <ma...@gmail.com>.
Thanks, the aspectj runs though, it just doesn't weave my aj classes in.

My layout is default with: src/main/aspect and src/main/java

and my build.ajproperties:
src.includes = src/main/java, src/test/java, src/main/aspect,
src/test/aspect

Aspectj apears to try to weave the classes because it outputs minor warnings
when verbose is on.
My only lead is either default maven compiler is overwriting classes, or
there is an error in the latest aspectj-maven-plugin SNAPSHOT, which I need
to use because I have java 1.6 code? Can you suggest another aspectj plugin
that works with 1.6?

The aspects compile correctly in eclipse and all test cases pass?

thanks for your help,
Matt.


Chris Lieb wrote:
> 
> I've never had this issue with aspectj-maven-plugin.  Here is the
> configuration that I use for the compiler and aspectj plugins (works
> with jar and war packaging, perhaps others):
> 
>     <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>             <source>1.5</source>
>             <target>1.5</target>
>             <showWarnings>true</showWarnings>
>             <showDeprecation>true</showDeprecation>
>             <encoding>UTF-8</encoding>
>         </configuration>
>     </plugin>
> 
>     <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>aspectj-maven-plugin</artifactId>
>         <executions>
>             <execution>
>                 <goals>
>                     <goal>compile</goal>
>                     <goal>test-compile</goal>
>                 </goals>
>             </execution>
>         </executions>
>         <configuration>
>             <source>1.5</source>
>             <target>1.5</target>
>             <encoding>UTF-8</encoding>
>         </configuration>
>         <dependencies>
>             <dependency>
>                 <groupId>org.aspectj</groupId>
>                 <artifactId>aspectjrt</artifactId>
>                 <version>1.6.1</version>
>             </dependency>
>             <dependency>
>                 <groupId>org.aspectj</groupId>
>                 <artifactId>aspectjtools</artifactId>
>                 <version>1.6.1</version>
>             </dependency>
>         </dependencies>
>     </plugin>
> 
> -- Chris
> 
> matthew hindle wrote:
>> Apologies Nabble 2 seemed to mess the code up.
>>
>> Hi, I'm trying to override the default maven compiler with
>> aspectj-maven-plugin. But it insists on compiling.
>>
>> My compiler settings are:
>>
>> <plugin>
>> 	<groupId>org.codehaus.mojo</groupId>
>> 	<artifactId>aspectj-maven-plugin</artifactId>
>> 	<version>1.1-alpha</version>
>> 	<configuration>
>> 		<complianceLevel>1.6</complianceLevel>
>> 		<source>1.6</source>
>> 		<target>1.6</target>
>> 		<showWeaveInfo>true</showWeaveInfo>
>> 		<Xlint>warning</Xlint>
>>                       	<aspectDirectory>src/main/aspect</aspectDirectory>
>> 		<verbose>true</verbose>
>> 	</configuration>
>> 	<dependencies>
>> 		<dependency>
>> 			<groupId>org.aspectj</groupId>
>> 			<artifactId>aspectjrt</artifactId>
>> 			<version>1.6.1</version>
>> 		</dependency>
>> 	<dependency>
>> 		<groupId>org.aspectj</groupId>
>> 		<artifactId>aspectjtools</artifactId>
>> 		<version>1.6.1</version>
>> 	</dependency>
>> 	<dependencies>
>> 	<executions>
>> 	         <execution>
>> 	               <id>compile</id>
>> 	                <phase>compile</phase>
>> 	                <goals>
>> 	                        	<goal>compile</goal>
>> 	                </goals>
>> 	          </execution>
>> 	          <execution>
>> 	                 <id>test-compile</id>
>> 	                  <phase>test-compile</phase>
>> 	                   <goals>
>> 			<goal>test-compile</goal>
>> 	                   </goals>
>> 	          </execution>
>>            </executions>
>> </plugin>
>>
>> I have even tried to exclude compiled classes with:
>>
>> <plugin> 
>> 	<artifactId>maven-compiler-plugin</artifactId> 
>> 	<configuration>
>> 		<excludes>
>> 			<exclude>**/*.*</exclude>
>> 		</excludes>
>> 	</configuration>
>> </plugin> 
>>
>> This still tries to compile the test cases.
>>
>> Many Thanks,
>> Matt.
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/override-maven-compiler-plugin--tp1557710p1557954.html
Sent from the maven users mailing list archive at Nabble.com.


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


Re: override maven-compiler-plugin?

Posted by Chris Lieb <ch...@gmail.com>.
I've never had this issue with aspectj-maven-plugin.  Here is the
configuration that I use for the compiler and aspectj plugins (works
with jar and war packaging, perhaps others):

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.5</source>
            <target>1.5</target>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <encoding>UTF-8</encoding>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                    <goal>test-compile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <source>1.5</source>
            <target>1.5</target>
            <encoding>UTF-8</encoding>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>1.6.1</version>
            </dependency>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjtools</artifactId>
                <version>1.6.1</version>
            </dependency>
        </dependencies>
    </plugin>

-- Chris

matthew hindle wrote:
> Apologies Nabble 2 seemed to mess the code up.
>
> Hi, I'm trying to override the default maven compiler with
> aspectj-maven-plugin. But it insists on compiling.
>
> My compiler settings are:
>
> <plugin>
> 	<groupId>org.codehaus.mojo</groupId>
> 	<artifactId>aspectj-maven-plugin</artifactId>
> 	<version>1.1-alpha</version>
> 	<configuration>
> 		<complianceLevel>1.6</complianceLevel>
> 		<source>1.6</source>
> 		<target>1.6</target>
> 		<showWeaveInfo>true</showWeaveInfo>
> 		<Xlint>warning</Xlint>
>                       	<aspectDirectory>src/main/aspect</aspectDirectory>
> 		<verbose>true</verbose>
> 	</configuration>
> 	<dependencies>
> 		<dependency>
> 			<groupId>org.aspectj</groupId>
> 			<artifactId>aspectjrt</artifactId>
> 			<version>1.6.1</version>
> 		</dependency>
> 	<dependency>
> 		<groupId>org.aspectj</groupId>
> 		<artifactId>aspectjtools</artifactId>
> 		<version>1.6.1</version>
> 	</dependency>
> 	<dependencies>
> 	<executions>
> 	         <execution>
> 	               <id>compile</id>
> 	                <phase>compile</phase>
> 	                <goals>
> 	                        	<goal>compile</goal>
> 	                </goals>
> 	          </execution>
> 	          <execution>
> 	                 <id>test-compile</id>
> 	                  <phase>test-compile</phase>
> 	                   <goals>
> 			<goal>test-compile</goal>
> 	                   </goals>
> 	          </execution>
>            </executions>
> </plugin>
>
> I have even tried to exclude compiled classes with:
>
> <plugin> 
> 	<artifactId>maven-compiler-plugin</artifactId> 
> 	<configuration>
> 		<excludes>
> 			<exclude>**/*.*</exclude>
> 		</excludes>
> 	</configuration>
> </plugin> 
>
> This still tries to compile the test cases.
>
> Many Thanks,
> Matt.
>   

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


Re: override maven-compiler-plugin?

Posted by Stephen Connolly <st...@gmail.com>.
I think you'll need to change the packaging from jar in order to remove the
default execution of the maven-compiler-plugin...

of course you'll have to add back in all the other plugins that you need
(i.e. resources, surefire, jar, etc)

2008/11/20 matthew hindle <ma...@gmail.com>

>
> Apologies Nabble 2 seemed to mess the code up.
>
> Hi, I'm trying to override the default maven compiler with
> aspectj-maven-plugin. But it insists on compiling.
>
> My compiler settings are:
>
> <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>aspectj-maven-plugin</artifactId>
>        <version>1.1-alpha</version>
>        <configuration>
>                <complianceLevel>1.6</complianceLevel>
>                <source>1.6</source>
>                <target>1.6</target>
>                <showWeaveInfo>true</showWeaveInfo>
>                <Xlint>warning</Xlint>
>                        <aspectDirectory>src/main/aspect</aspectDirectory>
>                <verbose>true</verbose>
>        </configuration>
>        <dependencies>
>                <dependency>
>                        <groupId>org.aspectj</groupId>
>                        <artifactId>aspectjrt</artifactId>
>                        <version>1.6.1</version>
>                </dependency>
>        <dependency>
>                <groupId>org.aspectj</groupId>
>                <artifactId>aspectjtools</artifactId>
>                <version>1.6.1</version>
>        </dependency>
>        <dependencies>
>        <executions>
>                 <execution>
>                       <id>compile</id>
>                        <phase>compile</phase>
>                        <goals>
>                                        <goal>compile</goal>
>                        </goals>
>                  </execution>
>                  <execution>
>                         <id>test-compile</id>
>                          <phase>test-compile</phase>
>                           <goals>
>                        <goal>test-compile</goal>
>                           </goals>
>                  </execution>
>           </executions>
> </plugin>
>
> I have even tried to exclude compiled classes with:
>
> <plugin>
>        <artifactId>maven-compiler-plugin</artifactId>
>        <configuration>
>                <excludes>
>                        <exclude>**/*.*</exclude>
>                </excludes>
>        </configuration>
> </plugin>
>
> This still tries to compile the test cases.
>
> Many Thanks,
> Matt.
> --
> View this message in context:
> http://www.nabble.com/override-maven-compiler-plugin--tp20604615p20604672.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: override maven-compiler-plugin?

Posted by matthew hindle <ma...@gmail.com>.
Appologies Nabble 2 seemed to mess the code up.

Hi, I'm trying to override the default maven compiler with
aspectj-maven-plugin. But it insists on compiling.

My compiler settings are:

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>aspectj-maven-plugin</artifactId>
	<version>1.1-alpha</version>
	<configuration>
		<complianceLevel>1.6</complianceLevel>
		<source>1.6</source>
		<target>1.6</target>
		<showWeaveInfo>true</showWeaveInfo>
		<Xlint>warning</Xlint>
                      	<aspectDirectory>src/main/aspect</aspectDirectory>
		<verbose>true</verbose>
	</configuration>
	<dependencies>
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<version>1.6.1</version>
		</dependency>
	<dependency>
		<groupId>org.aspectj</groupId>
		<artifactId>aspectjtools</artifactId>
		<version>1.6.1</version>
	</dependency>
	<dependencies>
	<executions>
	         <execution>
	               <id>compile</id>
	                <phase>compile</phase>
	                <goals>
	                        	<goal>compile</goal>
	                </goals>
	          </execution>
	          <execution>
	                 <id>test-compile</id>
	                  <phase>test-compile</phase>
	                   <goals>
			<goal>test-compile</goal>
	                   </goals>
	          </execution>
           </executions>
</plugin>

I have even tried to exclude compiled classes with:

<plugin> 
	<artifactId>maven-compiler-plugin</artifactId> 
	<configuration>
		<excludes>
			<exclude>**/*.*</exclude>
		</excludes>
	</configuration>
</plugin> 

This still tries to compile the test cases.

Many Thanks,
Matt.
-- 
View this message in context: http://www.nabble.com/override-maven-compiler-plugin--tp20604615p20604672.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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