users@glassfish.java.net

Re: Maven2 junit test not finding src/resources/META-INF/persistence.xml

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Sep 2008 05:39:40 PDT

Thanks Mitesh Meswani,

[b]Now i'm able to successfully build project the instruction to achieve this are mention below, but having issue, now when i'm follow same steps as mention below it's working on my system but when trying the same steps on any other oprating system then same error, as i faced in past(class not found toplink...blah blah).

Thanks a lot[/b]


1 step ) removed .m2 column from C:\Documents and Settings\username

2 step ) open cmd, before that make sure that your JAVA_HOME properly set and 'path' system variable pointing to maven2 'bin' directory.

3 step ) move inside the project directory

4 step ) run "mvn install" command

5 step ) it will throw javaee.jar artifact not found or download error.

6 step ) download them manually as follow

manual installation of artifact javaee.jar and toplink-essentials.jar

mvn install:install-file -DgroupId=org.glassfish -DartifactId=javaee -Dversion=2.2 -Dpackaging=jar -Dfile=c:\javaee.jar

mvn install:install-file -DgroupId=com.oracle.toplink -DartifactId=toplink -Dversion=10.1.3 -Dpackaging=jar -Dfile=c:\toplink-essentials.jar

and getting javaee.jar and toplink-essentials.jar from galssfish lib

7 step ) again run "mvn install" command, and this time it will be run successfully.

pom.xml

 <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.5</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javaee</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>com.oracle.toplink</groupId>
            <artifactId>toplink</artifactId>
            <version>10.1.3</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
[Message sent by forum member 'happy007' (happy007)]

http://forums.java.net/jive/thread.jspa?messageID=300088