Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does Maven handle WAR dependencies at compile time?
    primarykey
    data
    text
    <p>I'm using Maven 3 to handle a (large) project. This project defines a set of REST services, using Scala, Akka and the Spray framework. Each service is defined as an independent project, producing a WAR thanks to the "mvn package" command.</p> <p>I have to "assemble" these different services into a "system", that is, a subset of these services to be deployed for a given purpose, in a single WAR. Maven WAR overlay works good as a first impression: simply create a new project, and add the services to be included as dependencies. </p> <pre><code>&lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;net.modelbased.sensapp.service&lt;/groupId&gt; &lt;artifactId&gt;net.modelbased.sensapp.service.metamodel.repository&lt;/artifactId&gt; &lt;version&gt;0.0.1&lt;/version&gt; &lt;type&gt;war&lt;/type&gt; &lt;/dependency&gt; &lt;/dependencies&gt; </code></pre> <p>It works well, and the classes contained in the independent services are included in the final WAR.</p> <pre><code>jar tf target/net.modelbased.sensapp.system.envision-0.0.1-SNAPSHOT.war [...] WEB-INF/classes/net/modelbased/sensapp/service/metamodel/repository/ModelLister.class [...] </code></pre> <p>But ... The Spray framework requires the implementation of a bootstrap, that is, a class that load the implemented services. This file has to be compiled, as it is a plain scala class. But it looks like maven did not includes the WAR dependencies in the compilation classpath.</p> <p>I saw the WARpath plugin (http://static.appfuse.org/maven-warpath-plugin/) ... But It does not look more or less outdated. Is there a "standard" way of doing what I'd like to do (i.e., include a WAr in the compilation classpath). </p> <p>Ps. One of the requirement of the project is that each service MUST be deployable as an independent artifact. A solution could be to implement the core of the service as a JAR project, and also provide a WAR project that includes a refarence to the JAR and the associated config file. But it will multiply by 2 the number of project defined, which is not optimal in a way ...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload