Hi,

I have to accomplish this task, that I thought it was simple..., I have to
launch a java program (I used exec plugin) I issue the command

mvn -Premote -Dmaven.test.skip=true clean package exec:java

and I get


[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO]
------------------------------------------------------------------------
[INFO] Building ailclient
[INFO]    task-segment: [clean, package, exec:java]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\workspace-nb\ailclient\target
[INFO] Deleting directory C:\workspace-nb\ailclient\target\classes
[INFO] Deleting directory C:\workspace-nb\ailclient\target\test-classes
[INFO] Deleting directory C:\workspace-nb\ailclient\target\site
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[WARNING] While downloading activation:activation:1.0.2
  This artifact has been relocated to javax.activation:activation:1.0.2.


[INFO] [compiler:compile]
[INFO] Compiling 11 source files to C:\workspace-nb\ailclient\target\classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] Tests are skipped.
[INFO] [jar:jar]
[INFO] Building jar: C:\workspace-nb\ailclient\target\ailclient-
1.1-SNAPSHOT.jar

[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java]
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] javax/jms/MessageListener
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.NoClassDefFoundError: javax/jms/MessageListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(
SecureClassLoader.java:12
4)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at org.codehaus.mojo.exec.ExecJavaMojo$IsolatedClassLoader.loadClass
(Exe
cJavaMojo.java:265)
        at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java
:113)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPlugi
nManager.java:447)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(Defa
ultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:493)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(Defau
ltLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java
:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Wed Jan 23 15:27:03 CET 2008
[INFO] Final Memory: 6M/14M
[INFO]
------------------------------------------------------------------------

As you can see the exec plugin complains that it's not able to find the
dependency javax.jms:jms:1.1 that definitely it's on the project classpath,
and I've tried to "force" the plugin to take it (as you can see from the pom
below)...

any ideas??? help appreciated...



the pom.xml



    <dependencies>
        <!-- Test Framework -->
        [...other dependencies]

        <!-- Dipendenze jaas -->
        <dependency>
            <groupId>javax.security</groupId>
            <artifactId>jaas</artifactId>
            <version>1.0.01</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

        <!-- Dipendenze javax.xml -->
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>

        </dependency>

        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.0EA3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jsr173</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxb-libs</artifactId>
            <version>1.0.5</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>2.0EA3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxp-api</artifactId>
            <version>1.3.1</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jax-qname</artifactId>
            <version>1.1</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>namespace</artifactId>
            <version>1.0.1</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>relaxngDatatype</groupId>
            <artifactId>relaxngDatatype</artifactId>
            <version>20020414</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>sax</groupId>
            <artifactId>sax</artifactId>
            <version>2.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.7.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>xsdlib</groupId>
            <artifactId>xsdlib</artifactId>
            <version>20030225</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>xmlsec</groupId>
            <artifactId>xmlsec</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Java Messaging System -->
*        <dependency>
            <groupId>javax.jms</groupId>
            <artifactId>jms</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
*
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.12</version>
            <scope>provided</scope>
        </dependency>

        <!-- Cross Reference al progetto comunication-lib -->
        <dependency>
            <groupId>com.galyleo</groupId>
            <artifactId>comunication-lib</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <!-- Altre dipendenze -->
        [... other dependencies..]

        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-j2ee_1.4_spec</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/resources/*</include>
                    </includes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.0.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <classpath>
                        <dependency>javax.activation:activation:1.0.2
</dependency>
                        <dependency>javax.jms:jms:1.1</dependency>
                    </classpath>
                    <mainClass>x.y.z.AILInterface</mainClass>
                    <commandLineArgs>-
Djava.security.policy=ailinterface.policy -
Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -
Djava.naming.provider.url=jnp://localhost:1099 -
Djava.naming.factory.url.pkgs=org.jboss.naming.client -
Dj2ee.clientName=AILInterface</commandLineArgs>
                </configuration>
            </plugin>

        </plugins>


Regards
Daniele

Reply via email to