Maven2 not compiling source

Posted by Grep on Stack Overflow See other posts from Stack Overflow or by Grep
Published on 2010-03-09T11:49:48Z Indexed on 2010/03/09 11:51 UTC
Read the original article Hit count: 262

Filed under:
|
|

Hi, I am new to Maven2 and have been having an issue with the compiling of the source for a RAR. Maven currently copies all the information located at my sourceDirectory instead of compiling it even though the console states that the source is being compiled. If I navigate to the sourceDirectory I find all my source files with no compiled class files. I have tried changing my outputDirectory to a different location and when I inspect this directory I find that it only copied my source files instead of compiling them. I have added an example of my POM. Any advice would be appreciated and please keep in mind I have only started learning/implementing Maven2 yesterday :)

    <?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>MyApp</artifactId>
  <groupId>.</groupId>
  <version>4</version>
  <packaging>rar</packaging>
  <name>MyApp rar</name>
  <build>
    <directory>target\${artifactId}-${version}</directory>
    <resources>
        <resource>
            <directory>..\gen-src</directory>
            <excludes>
                <exclude>util.jar</exclude>
            </excludes>
        </resource>
        <resource>
            <directory>..\domain</directory>
        </resource>
    </resources>
    <sourceDirectory>target\${artifactId}-${version}</sourceDirectory>
     <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-rar-plugin</artifactId>
        <configuration>
            <workDirectory>target\${artifactId}-${version}\classes</workDirectory>
            <outputDirectory>target</outputDirectory>
            <finalName>MyApp${version}</finalName>
            <raXmlFile>${workDirectory}\META-INF\ra.xml</raXmlFile>
        </configuration>
      </plugin>
    </plugins>  
  </build>
</project>

© Stack Overflow or respective owner

Related posts about maven

Related posts about compile