开发者

"Unresolved compilation problems" with Maven multi-module EAR files

开发者 https://www.devze.com 2023-02-06 06:10 出处:网络
The JSP\'s in the war module won\'t compile because the jar module isn\'t on the classpath when they are compiled.

The JSP's in the war module won't compile because the jar module isn't on the classpath when they are compiled.

EAR module dependencies

  <dependencies>
  <dependency>
   <artifactId>rtuDataAccess</artifactId>
   <groupId>${project.groupId}</groupId>
   <version>${project.version}</version>
   <type>jar</type>
  </dependency>
  <dependency>
   <artifactId>rtu</artifactId>
   <groupId>${project.groupId}</groupId>
   <version>${project.version}</version>
   <type>war</type>
  </dependency>
  <dependency>
   <artifactId>rtuEformProcess</artifactId>
   <groupId>${project.groupId}</groupId>
   <version>${project.version}</version>
   <type>war</type>
  </dependency>

 </dependencies>

EAR plugin setup

    <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.4.2</version>

<configuration>
    <defaultJavaBundleDir>lib/</defaultJavaBundleDir>
 <modules>
  <jarModule>
   <groupId>edu.mayo.lpea.lsa</groupId>
   <artifactId>rtuDataAccess</artifactId>
  </jarModule>

  <webModule>
   <groupId>edu.mayo.lpea.lsa</groupId>
   <artifactId>rtu</artifactId>
   <contextRoot>/lsa/rtu</contextRoot>
  </webModule>
  <webModule>
   <groupId>edu.mayo.lpea.lsa</groupId>
   <artifactId>rtuEformProcess</artifactId>
   <contextRoot>/lsa/rtuEformProcess</contextRoot>
  </webModule>
 </modules>
</configuration>

WAR plugin (in war module)

       <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
            <configuration>
                <warName>${project.artifactId}</warName>
                <ignoreWebxml>true</ignoreWebxml>
                <archive>
                   <manifest>
                       <classpathPrefix>lib/</classpathPrefix>
                       <addClasspath>true</addClasspath>
                   </manifest>
                </archive>开发者_运维百科
            </configuration>

0

精彩评论

暂无评论...
验证码 换一张
取 消