1

マルチモジュール Maven プロジェクトの war ファイルをデプロイするための Jenkins ジョブをセットアップしようとしています。私のプロジェクト構造はこれに匹敵します:

--Platform
 |-- Core
   |-- ...
 |-- Backend
   |-- BackendWeb
 |-- Frontend
   |-- WebFrotnend1
   |-- WebService
   |-- ...

SVN からルート (プラットフォーム) を取得するジョブを作成し、Maven ですべてをビルドすることができました。このジョブでビルドされた war ファイルは、手動で展開すると正常に動作します。

ここで、Tomcat-maven-plugin を使用して、たとえば「BackendWeb」モジュールのみをビルドおよびデプロイするためのジョブを作成したいと考えています。

これを実現するために、別のジョブを作成しようとしました。このジョブは、プロジェクト全体ではなく単一のモジュールを取得し、Tomcat の再デプロイ ゴールを実行するだけです。一見、ビルドとデプロイは問題ないように見えますが、Tomcat ログには次のように表示されます。

Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.myproject.core.service.config.ConfigurationService]
: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
        The import com.myproject.core.config.ConfigEntry cannot be resolved
        ConfigEntry cannot be resolved to a type
        The method getByKey(String) from the type ConfigurationDAO refers to the missing type ConfigEntry
        ConfigEntry cannot be resolved to a type
        ConfigEntry cannot be resolved to a type

        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
        ... 69 more
Caused by: java.lang.Error: Unresolved compilation problems:
        The import com.myproject.core.config.ConfigEntry cannot be resolved
        ConfigEntry cannot be resolved to a type
        The method getByKey(String) from the type ConfigurationDAO refers to the missing type ConfigEntry
        ConfigEntry cannot be resolved to a type
        ConfigEntry cannot be resolved to a type

私は何かを忘れましたか?このビルドが最初のジョブのビルドと異なる理由はわかりません。依存関係は同じ Maven リポジトリから取得する必要があります。

これまでのところ、この問題の解決策は Web 上で見つかりませんでした。これを達成するためのJenkinsのベストプラクティスはありますか?

4

1 に答える 1

0

tomcat:redeploy の前に clean タスクを追加するのを忘れただけです。なぜ解決策を見つけるのに何年もかかったのかわかりません;(

于 2013-06-06T12:01:59.130 に答える