I am trying to run a Spring Batch job through Jenkins.
In my *local machine*, executing
mvn clean compile -PPLAYER_INFO_JOB
will trigger the following plugin in pom.xml to execute
<profile>
<id>PLAYER_INFO_JOB</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>org.springframework.batch.core.launch.support.CommandLineJobRunner</argument>
<argument>launch-context.xml</argument>
<argument>PLAYER_INFO_JOB</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
and the batch job is run successfully,
however in *Jenkins* it gives me the following error
2013-08-02 11:24:14,890 ERROR
[org.springframework.batch.core.launch.support.CommandLineJobRunner] -
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'playerSearchStep': Cannot resolve reference to bean
'playerInfoItemReader' while setting bean property 'itemReader'; nested
exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'playerInfoItemReader' is defined
playerInfoItemReader is just a simple reader annotated with @Component
package com.iecanfly.kbo.player;
@Component("playerInfoItemReader")
public class PlayerInfoItemReader implements ItemReader<Element> {
and in my launch-context.xml
I have the following line
<context:component-scan base-package="com.iecanfly.kbo" />
I am having difficult time understanding *why the spring context loaded by
jenkins is missing the "playerInfoItemReader"?*
Any help would be very much appreciated.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.