1

Web アプリケーションを Tomcat 7 から Jetty 9 に移行しています。Jetty の起動には Ant タスクが使用されます。Jar ファイルは WEB-INF/lib の下にあり、クラス ファイルは .build/classes の下にあります。

問題は、アノテーション スキャンを実行するときに、jar の代わりにクラス ファイルを含むフォルダーを指定する方法はありますか?

以下は、使用されている Ant ターゲット構成です。

  <target name="jetty.run">
    <jetty.run tempDirectory="jetty-temp">
      <webApp war="app" contextpath="/">
        <attributes>
          <attribute name="org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern" value=".*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$"/>
          <attribute name="org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern" value=".*classes.*"/>
        </attributes>
        <classes dir=".build/classes">
          <include name="**/*.class" />
        </classes>
        <!--<lib dir=".build/classes">
          <include name="**/*.class" />
        </lib>-->
      </webApp>
      <connectors>
        <connector port="8090"/>
        <connector port="80"/>
      </connectors>
    </jetty.run>
  </target>

classes 要素を指定しようとしましたが、無視されているようです (.build フォルダーは build.xml と同じ場所にあります)。したがって、アプリケーションを適切に起動するには、アプリケーション コード jar をビルドして WEB-INF/lib にコピーする必要があります。

Jar は標準の場所にありますが、クラスはそうではありません。これはどういうわけかこれを引き起こす可能性がありますか?

どんな助けにも感謝します。

ありがとう、ヴィタリー。

4

1 に答える 1