문제

I'm trying to deploy a jar file containing my EJBs to JBoss 5, using the jboss-maven-plugin. But the plugin can't find my jar file.

I'm running the command: mvn jboss:deploy

This is what my configuration in my POM.xml looks like:

<build>
    <finalName>my-ejb</finalName>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jboss-maven-plugin</artifactId>
            <version>1.5.0</version>
            <configuration>
                <hostName>localhost</hostName>
                <port>8080</port>
                <fileNames>
                    <fileName>target/my-ejb-1.0-SNAPSHOT.jar</fileName>
                </fileNames>
            </configuration>
        </plugin>
    </plugins>
 </build>

This is the error message that I get on my JBoss' console:

14:36:50,371 ERROR [[HtmlAdaptor]] Servlet.service() for servlet HtmlAdaptor threw exception
java.io.FileNotFoundException: my-ejb-1.0-SNAPSHOT.jar doesn't exist. (rootURI: file:/Users/hordine/software/jboss-5.1.0.GA/bin/target/my-ejb-1.0-SNAPSHOT.jar, file: /Users/hordine/software/jboss-5.1.0.GA/bin/target/my-ejb-1.0-SNAPSHOT.jar)

Funny thing is, "/Users/hordine/software/jboss-5.1.0.GA" is my JBOSS_HOME. Why is it looking for a jar file to deploy to JBoss inside JBoss itself?

How can I configure this file name so that it can be found?

도움이 되었습니까?

해결책

I need to prepend the fileName with ${project.basedir}/:

<fileName>${project.basedir}/target/my-ejb-1.0-SNAPSHOT.jar</fileName>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top