title: maven assembly: unresolved compilation error
body: <p>I've an application that uses Maven to build a JAR with the maven-assembly-plugin.</p>
  
  <p>The project includes a list of dependencies and one of these is another Maven project.
  I'm developing with Eclipse and when I run the project everything works fine. When I build with the Maven goal <code>assembly:assembly</code>, it makes the JAR but when I run the JAR it gives me this error: </p>
  
  <pre class="lang-none prettyprint-override"><code>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
      The method configure(Map&lt;String,String&gt;) of type SMTPMailService must 
        override a superclass method
      at rey.sto.utils.mail.SMTPMailService.configure(SMTPMailService.java:89)
      at com.ppl_sftp.transfer.FileTransfer.startTransfer(FileTransfer.java:232)
      at com.ppl_sftp.transfer.MainApp.main(MainApp.java:33)
  </code></pre>
  
  <p>Here is the pom.xml file of the main project:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;com.ppl-sftp&lt;/groupId&gt;
  &lt;artifactId&gt;transfer&lt;/artifactId&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
  &lt;name&gt;A Camel Route&lt;/name&gt;
  &lt;url&gt;http://www.myorganization.org&lt;/url&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;!-- logging --&gt;
  
      &lt;!-- testing --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
          &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
          &lt;version&gt;2.10.0&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;optional&gt;false&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;1.6.6&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;optional&gt;false&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;version&gt;1.6.6&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;optional&gt;false&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.16&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;optional&gt;false&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.xerial&lt;/groupId&gt;
          &lt;artifactId&gt;sqlite-jdbc&lt;/artifactId&gt;
          &lt;version&gt;3.7.2&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;optional&gt;false&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
          &lt;artifactId&gt;camel-test&lt;/artifactId&gt;
          &lt;version&gt;2.10.0&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;scope&gt;test&lt;/scope&gt;
          &lt;optional&gt;false&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
          &lt;artifactId&gt;camel-ftp&lt;/artifactId&gt;
          &lt;version&gt;2.9.2&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;optional&gt;false&lt;/optional&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;my-utils&lt;/groupId&gt;
          &lt;artifactId&gt;my-utils&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
           &lt;groupId&gt;javax.activation&lt;/groupId&gt;
           &lt;artifactId&gt;activation&lt;/artifactId&gt;
           &lt;version&gt;1.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.mail&lt;/groupId&gt;
          &lt;artifactId&gt;javax.mail&lt;/artifactId&gt;
          &lt;version&gt;1.4.5&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;defaultGoal&gt;install&lt;/defaultGoal&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.6&lt;/source&gt;
                  &lt;target&gt;1.6&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;!-- allows the route to be ran via 'mvn camel:run' --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.10.0&lt;/version&gt;
          &lt;/plugin&gt;
          &lt;!-- Allows the example to be run via 'mvn compile exec:java' --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.2.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;mainClass&gt;com.ppl_sftp.transfer.MainApp&lt;/mainClass&gt;
                  &lt;includePluginDependencies&gt;false&lt;/includePluginDependencies&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;archive&gt;
                      &lt;manifest&gt;
                          &lt;mainClass&gt;com.ppl_sftp.transfer.MainApp&lt;/mainClass&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
                  &lt;descriptorRefs&gt;
                      &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                  &lt;/descriptorRefs&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this is the pom of the my-utils project dependency:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;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"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;rey-sto-utils&lt;/groupId&gt;
  &lt;artifactId&gt;rey-sto-utils&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.6&lt;/source&gt;
                  &lt;target&gt;1.6&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;2.0-beta2&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.21&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;ojdbc6&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
          &lt;version&gt;6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.activation&lt;/groupId&gt;
          &lt;artifactId&gt;activation&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.mail&lt;/groupId&gt;
          &lt;artifactId&gt;javax.mail&lt;/artifactId&gt;
          &lt;version&gt;1.4.5&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>
  
  <p>The problem is related to the Java mail dependency. As you can see I've used  <code>com.sun.mail</code> but I saw some other different libraries that correspond to <code>javax.mail</code>.</p>
  
  <p>Maybe I'm missing something in my poms, such as configuration parameters or plugins.</p>
  
  <p>I've also tried to put in my local repository a mail.jar that works fine in other projects but I get the same error.</p>