同一个java工程打两个不同的包

目的:1、打一个普通java包,用于spring aop
      2、用aspectj打一个包,用于字节码加强的实现方式

实现:
    
     	<profiles>
		<profile>
			<id>aspectj</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>aspectj-maven-plugin</artifactId>
						<version>1.8</version>
						<executions>
							<execution>
								<goals>
									<goal>compile</goal>
								</goals>

								<configuration>
									<complianceLevel>1.7</complianceLevel>
									<source>1.7</source>
									<target>1.7</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<id>default-jar</id>
								<phase>none</phase>
							</execution>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<classifier>aspectj</classifier>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
     

猜你喜欢

转载自pcpig.iteye.com/blog/2318828