dev@glassfish.java.net

Re: Error for maven dependencies when using GF embedded API

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 30 Oct 2008 18:35:15 +0100

Hi Harsha,

Thanks, that works. At the end of the email is the complete pom file.

I also have this in the pom file:

             <plugin>
                 <groupId>org.glassfish</groupId>
                 <artifactId>maven-glassfish-plugin</artifactId>
             </plugin>

so that i can do:

   mvn glassfish:run

is that correct?

The logging output from GF when i run the unit tests using the GF API
and do mvn glassfish:run are different so they may be referring to
different versions.

Also i notice this occurs every time i execute maven:

Downloading: http://download.java.net/maven/2//com/sun/faces/extensions/jsf-extensions-dynamic-faces/0.1/jsf-extensions-dynamic-faces-0.1.pom
Downloading: http://download.java.net/maven/1/com.sun.faces.extensions/poms/jsf-extensions-dynamic-faces-0.1.pom
Downloading: http://download.java.net/maven/glassfish/com/sun/faces/extensions/jsf-extensions-dynamic-faces/0.1/jsf-extensions-dynamic-faces-0.1.pom
Downloading: http://repo1.maven.org/maven2/com/sun/faces/extensions/jsf-extensions-dynamic-faces/0.1/jsf-extensions-dynamic-faces-0.1.pom

Paul.



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd
">
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.sun.jersey.samples</groupId>
     <version>1.0.1-SNAPSHOT</version>
     <artifactId>helloworld-webapp</artifactId>
     <name>Helloworld WebApp - Jersey sample</name>
     <packaging>war</packaging>
     <profiles>
         <profile>
             <id>jdk-1.5</id>
             <activation>
                 <jdk>1.5</jdk>
             </activation>
             <dependencies>
                 <dependency>
                     <groupId>com.sun.xml.bind</groupId>
                     <artifactId>jaxb-impl</artifactId>
                     <version>2.1</version>
                 </dependency>
             </dependencies>
         </profile>
     </profiles>
     <dependencies>
         <dependency>
             <groupId>com.sun.jersey</groupId>
             <artifactId>jersey-server</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>3.8.2</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.glassfish.embedded</groupId>
             <artifactId>glassfish-embedded-api</artifactId>
             <version>3.0-Prelude-b28b</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.sun.jersey</groupId>
             <artifactId>jersey-client</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
     <build>
         <finalName>helloworld-webapp</finalName>
         <plugins>
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <inherited>true</inherited>
                 <configuration>
                     <source>1.5</source>
                     <target>1.5</target>
                 </configuration>
             </plugin>
             <!-- Run the application using "mvn glassfish:run" -->
             <plugin>
                 <groupId>org.glassfish</groupId>
                 <artifactId>maven-glassfish-plugin</artifactId>
             </plugin>
             <plugin>
                 <groupId>org.glassfish.build</groupId>
                 <artifactId>maven-glassfish-plugin</artifactId>
                 <version>3.0-Prelude-b28b</version>
                 <extensions>true</extensions>
             </plugin>
             <plugin>
                 <artifactId>maven-assembly-plugin</artifactId>
                 <configuration>
                     <descriptors>
                         <descriptor>src/main/assembly/src.xml</
descriptor>
                     </descriptors>
                 </configuration>
                 <executions>
                     <execution>
                         <id>make-assembly</id> <!-- this is used for
inheritance merges -->
                         <phase>package</phase> <!-- append to the
packaging phase. -->
                         <goals>
                             <goal>attached</goal> <!-- goals == mojos
-->
                         </goals>
                     </execution>
                 </executions>
             </plugin>
         </plugins>
         <extensions>
             <extension>
                 <groupId>org.glassfish.build</groupId>
                 <artifactId>maven-glassfish-extension</artifactId>
                 <version>3.0-Prelude-b28b</version>
             </extension>
         </extensions>
     </build>
     <pluginRepositories>
         <pluginRepository>
             <id>maven2-repository.dev.java.net</id>
             <name>Java.net Repository for Maven</name>
             <url>http://download.java.net/maven/2/</url>
             <layout>default</layout>
         </pluginRepository>
         <pluginRepository>
             <id>maven-repository.dev.java.net</id>
             <name>Java.net Maven 1 Repository (legacy)</name>
             <url>http://download.java.net/maven/1</url>
             <layout>legacy</layout>
         </pluginRepository>
         <pluginRepository>
             <id>glassfish-repository</id>
             <name>Java.net Repository for Glassfish</name>
             <url>http://download.java.net/maven/glassfish</url>
         </pluginRepository>
     </pluginRepositories>
     <repositories>
         <repository>
             <id>maven2-repository.dev.java.net</id>
             <name>Java.net Repository for Maven</name>
             <url>http://download.java.net/maven/2/</url>
             <layout>default</layout>
         </repository>
         <repository>
             <id>maven-repository.dev.java.net</id>
             <name>Java.net Maven 1 Repository (legacy)</name>
             <url>http://download.java.net/maven/1</url>
             <layout>legacy</layout>
         </repository>
         <repository>
             <id>glassfish-repository</id>
             <name>Java.net Repository for Glassfish</name>
             <url>http://download.java.net/maven/glassfish</url>
         </repository>
     </repositories>
     <properties>
         <netbeans.hint.deploy.server>gfv3</netbeans.hint.deploy.server>
     </properties>
     <distributionManagement>
         <repository>
             <uniqueVersion>false</uniqueVersion>
             <id>java.net-m2-dist-repository</id>
             <name>java.net-m2-repository</name>
             <url>java-net:/maven2-repository/trunk/www/repository/</
url>
         </repository>
     </distributionManagement>
</project>


On Oct 30, 2008, at 6:34 PM, Harsha Godugu wrote:

> Add the following under your <build> section of pom and let me
> know if this fixed the problem.
> Please note the version tag. It could be whatever version (prelude /
> snapshot-> trunk) that your project needs.
>
> < <build>
> < <plugins>
> < <plugin>
> < <groupId>org.glassfish.build</groupId>
> < <artifactId>maven-glassfish-plugin</artifactId>
> < <version>3.0-Prelude-b28b</version>
> < <extensions>true</extensions>
> < </plugin>
> < </plugins>
> < <extensions>
> < <extension>
> < <groupId>org.glassfish.build</groupId>
> < <artifactId>maven-glassfish-extension</artifactId>
> < <version>3.0-Prelude-b28b</version>
> < </extension>
> < </extensions>
> < </build>
> Vivek Pandey wrote: