title: How to get an executable jar for a weld se application
body: <p>I have a little cli application that uses weld se that works fine if i run the application from within eclipse 
  (using the main method from weld se: org.jboss.weld.environment.se.StartMain)</p>
  
  <p>The problem is i can't create an executable jar that works. At the moment i use maven-assembly-plugin:</p>
  
  <pre><code>&lt;plugin&gt;                                                                      
      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;                            
      &lt;configuration&gt;                                                           
          &lt;archive&gt;                                                             
              &lt;manifest&gt;                                                        
                  &lt;addClasspath&gt;true&lt;/addClasspath&gt;                             
                  &lt;mainClass&gt;org.jboss.weld.environment.se.StartMain&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;executions&gt;                                                              
          &lt;execution&gt;                                                           
              &lt;id&gt;make-my-jar-with-dependencies&lt;/id&gt;                            
              &lt;phase&gt;package&lt;/phase&gt;                                            
              &lt;goals&gt;                                                           
                  &lt;goal&gt;single&lt;/goal&gt;                                           
              &lt;/goals&gt;                                                          
          &lt;/execution&gt;                                                          
      &lt;/executions&gt;                                                             
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I also tried the shade plugin with:
  <code>&lt;transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/&gt;</code></p>
  
  <p>But in all cases i get the same many errors:</p>
  
  <pre><code>Nov 03, 2015 5:50:21 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
  INFO: WELD-000119: Not generating any bean definitions from org.jboss.weld.servlet.api.helpers.ForwardingServletListener because of underlying class loading error: Type javax.servlet.ServletContextListener not found.  If this is unexpected, enable DEBUG logging to see the full error.
  ... many of this kind with different classes
  Exception in thread "main" org.jboss.weld.exceptions.DeploymentException: java.lang.InternalError: Enclosing method not found
  ...
  Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.InternalError: Enclosing method not found
  ...
  Caused by: java.lang.InternalError: Enclosing method not found
  ...
  </code></pre>
  
  <p>In meantime i also tried to add </p>
  
  <pre><code>&lt;scan&gt;
      &lt;exclude name="org.jboss.weld.**" /&gt;
  &lt;/scan&gt;
  </code></pre>
  
  <p>to my beans.xml as suggested <a href="http://weld.cdi-spec.org/documentation/#5" rel="nofollow">here</a>. No change...</p>