Fred Bricon [https://community.jboss.org/people/fbricon] created the discussion

"Re: Jboss EE 6 EAR archetype, problem with EAR/lib"

To view the discussion, visit: https://community.jboss.org/message/789344#789344

--------------------------------------------------------------
Adding dependencies to an ear project doesn't make these dependencies available 
to the compilation classpath of its ejb/war/whatever modules.
Running mvn clean verify from your parent project folder clearly shows the ejb 
project doesn't compile.

You need to remove the flexjson dependency from the ear project and add it to 
the ejb pom.xml instead. 
That will add it to the project compilation classpath AND it will also be 
automatically deployed in the EAR's lib directory, as a transitive dependency.
Since the war project depends on the ejb, it'll see the flexjson jar as well. 
Now if the web project actually has a direct dependency towards flexjson, 
you'll need to add it to the war pom.xml as well : it's one of maven best 
practices as it will protect your project in case the ejb removes the 
dependency in the future. 
In that case,  the dependency should be added with a scope provided in the war 
pom.xml: 
<dependency>
          <groupId>net.sf.flexjson</groupId>
          <artifactId>flexjson</artifactId>
          <version>2.1</version>
   <scope>provided</scope>
</dependency>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/789344#789344]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to