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)
The problem is i can't create an executable jar that works. At the moment i use maven-assembly-plugin:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.jboss.weld.environment.se.StartMain</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-my-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
I also tried the shade plugin with:
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
But in all cases i get the same many errors:
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
...
In meantime i also tried to add
<scan>
<exclude name="org.jboss.weld.**" />
</scan>
to my beans.xml as suggested here. No change...