Sorry it didn't help, I just use maven to package the program using
appassembler-maven-plugin. This is so that the program itself can be run
without depending on maven. My main class is exactly as I posted earlier.

Regards,

On 7/3/07, kar <[EMAIL PROTECTED]> wrote:


Sadly this approach didn't help, fundamentally the program needs the
project
classpath as it contains the program being executed, as well as spring,
hibernate and other dependencies.

Since when you run mvn test, or mvn jetty:run-war, it executes this plugin
from the /target/classes dir, I need to somehow either add
/target/test-classes/WEB-INF to the classpath or have maven copy the
applicationContext.xml resouce to the /target/classes dir. I have tried
manually adding classpath settings to the exec plugin config, but I can't
get it to work :(

My plugin config is :

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <executions>
    <execution>
      <phase>process-test-resources</phase>
      <goals>
        <goal>exec</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <executable>java</executable>
    <includeProjectDependencies>true</includeProjectDependencies>
    <arguments>
      <argument>-classpath</argument>
      <classpath/>
      <argument>net.ajb.testapp.porter.RunPorter</argument>
    </arguments>
  </configuration>
</plugin>


fadhlirahim wrote:
>
> Hi there,
>
> I did something similiar and what I've done is just removed the
> "classpath*:" in the String array. The applicationContext*.xml are all
> placed in src/main/resource. This is how done it:
>
> public static void main(String[] args) {
>         try {
>             ApplicationContext ctx = new
> ClassPathXmlApplicationContext(new
> String[] {
>                     "applicationContext-resources.xml",
>                     "applicationContext-dao.xml",
>                     "applicationContext-service.xml"
>                     });
>
>             DataClient client = new DataClient((MitiMainManager)
> ctx.getBean
> ("mitiMainManager"));
>             client.addMitiMain();
>         } catch (Exception e) {
>             System.exit(1);
>         }
>     }
> --
> /fadhli
>
>

--
View this message in context:
http://www.nabble.com/Including-applicationContext.xml-in--target-classes-dir-tf4016846s2369.html#a11409310
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
/fadhli

Reply via email to