2016-12-09 2 views
0

Ich benutze aspectj-maven-plugin und jetty-all in meinem Java-Projekt.Aspectj maven plugin & jetty-all kompilieren warnen

Aber nach dem Lauf "mvn sauber installieren" wird es eine Warnmeldung sein.

.... 
[INFO] --- aspectj-maven-plugin:1.8:compile (default) @ as --- 
[INFO] Showing AJC message detail for messages of types: [error, warning, fail] 
[WARNING] incorrect classpath: /home/xxxx/.m2/repository/org/eclipse/jetty/aggregate/jetty-all/9.3.8.v20160314/jetty-all-9.3.8.v20160314.pom 
     <unknown source file>:<no line information> 
.... 

Wenn ich Aspectj Maven Plugin entfernen, wird es keine Warnung geben.

pom.xml:

<?xml version="1.0" encoding="UTF-8"?> 
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
     <modelVersion>4.0.0</modelVersion> 

    <groupId>xxx</groupId> 
    <artifactId>xxx</artifactId> 
    <version>0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>xxx</name> 
    <url>xxx</url> 
    <dependencies> 

     <dependency> 
      <groupId>org.eclipse.jetty.aggregate</groupId> 
      <artifactId>jetty-all</artifactId> 
      <version>9.3.8.v20160314</version> 
      <type>pom</type> 
     </dependency> 
     ... 
     <dependency> 
      <groupId>org.aspectj</groupId> 
      <artifactId>aspectjweaver</artifactId> 
      <version>1.8.7</version> 
     </dependency> 
     <dependency> 
      <groupId>org.aspectj</groupId> 
      <artifactId>aspectjrt</artifactId> 
      <version>1.8.7</version> 
     </dependency> 
    </dependencies> 
    <profiles> 
     ... 
    </profiles> 
    <build> 
     <finalName>xxx</finalName> 
     <resources> 
      <resource> 
       <directory>src/main/resources</directory> 
       <filtering>true</filtering> 
      </resource> 
     </resources> 
     <plugins> 
      <plugin> 
       <artifactId>maven-assembly-plugin</artifactId> 
       <configuration> 
        <archive> 
         <manifest> 
          <mainClass>xxx.xxx.Main</mainClass> 
         </manifest> 
        </archive> 
        <descriptorRefs> 
         <descriptorRef>jar-with-dependencies</descriptorRef> 
        </descriptorRefs> 
       </configuration> 
       <executions> 
        <execution> 
         <id>make-assembly</id> <!-- this is used for inheritance merges --> 
         <phase>package</phase> <!-- bind to the packaging phase --> 
         <goals> 
          <goal>single</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>aspectj-maven-plugin</artifactId> 
       <version>1.8</version> 
       <configuration> 
        <complianceLevel>1.8</complianceLevel> 
        <source>1.8</source> 
        <target>1.8</target> 
        <proc>none</proc> 
       </configuration> 
       <executions> 
        <execution> 
         <goals> 
          <goal>compile</goal> 
          <goal>test-compile</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jar-plugin</artifactId> 
       <version>2.3</version> 
       <configuration> 
        <archive> 
         <manifest> 
          <addClasspath>true</addClasspath> 
          <classpathPrefix>lib/</classpathPrefix> 
          <mainClass>xxx.xxx.Main</mainClass> 
         </manifest> 
        </archive> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <version>2.3</version> 
       <executions> 
        <execution> 
         <id>copy</id> 
         <phase>install</phase> 
         <goals> 
          <goal>copy-dependencies</goal> 
         </goals> 
         <configuration> 
          <outputDirectory>${project.build.directory}/lib</outputDirectory> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-antrun-plugin</artifactId> 
       <version>1.8</version> 
       <executions> 
        <execution> 
         <phase>compile</phase> 
         <goals> 
          <goal>run</goal> 
         </goals> 
         <configuration> 
          <target> 
           <exec dir="${basedir}" executable="svn" 
             failifexecutionfails="false" 
             output="${project.build.directory}/classes/svn.txt"> 
            <arg line="info"/> 
           </exec> 
          </target> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3</version> 
       <configuration> 
        <debug>true</debug> 
        <debuglevel>lines,vars,source</debuglevel> 
        <source>1.8</source> 
        <target>1.8</target> 
        <showWarnings>true</showWarnings> 
        <encoding>UTF-8</encoding> 
        <compilerArguments> 
         <extdirs>src/main/webapp/WEB-INF/lib</extdirs> 
        </compilerArguments> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.tomcat.maven</groupId> 
       <artifactId>tomcat7-maven-plugin</artifactId> 
       <version>2.2</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.1.1</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-source-plugin</artifactId> 
       <version>2.2.1</version> 
       <executions> 
        <execution> 
         <id>attach-sources</id> 
         <goals> 
          <goal>jar-no-fork</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
    <distributionManagement> 
     <!-- use the following if you're not using a snapshot version. --> 
     <repository> 
      <id>releases</id> 
      <url>xxx</url> 
     </repository> 
     <!-- use the following if you ARE using a snapshot version. --> 
     <snapshotRepository> 
      <id>snapshots</id> 
      <url>xxx</url> 
     </snapshotRepository> 
    </distributionManagement> 

</project> 

Kann mir jemand sagen, wie man es beheben?

+0

Könnten Sie bitte [SSCCE] (http://sscce.org/) auf GitHub posten? Es gibt viele Dinge, ich würde gerne das vollständige Bild sehen und nicht versuchen, Ihr POM in meinem Kopf zu analysieren, auf der Suche nach möglichen Problemen. – kriegaex

Antwort

0

Die Warnung, dass Sie durch das Plug-In verwendet werden erzeugt zu sehen bekommen:

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>aspectj-maven-plugin</artifactId> 
    <version>1.8</version> 
    <configuration> 
     <complianceLevel>1.8</complianceLevel> 
     <bootclasspath><!--try including correct classpath here--></bootclasspath> 
     <source>1.8</source> 
     <target>1.8</target> 
     <proc>none</proc> 
    </configuration> 
    <executions> 
     <execution> 
      <goals> 
       <goal>compile</goal> 
       <goal>test-compile</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin> 
Verwandte Themen