3 Replies Latest reply on Nov 25, 2009 1:21 AM by Arbi Sookazian

    Testing a portable extension

    Stuart Douglas Master

      If I was going to write a portable extension, how do I set up maven to allow me to bootstrap weld and test it?


      I am not really familiar with maven, and have been struggling with it all morning.

        • 1. Re: Testing a portable extension
          Gavin King Master

          I suppose you could copy the SE helloworld example?

          • 2. Re: Testing a portable extension
            Stuart Douglas Master

            That did the trick, thanks.

            • 3. Re: Testing a portable extension
              Arbi Sookazian Master

              So you're referring to the pom.xml (see below)?  Is there an easy way to create/edit a pom.xml via a GUI editor or JBoss/m2eclipse plugin?


              <?xml version="1.0" encoding="UTF-8"?>
              <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/maven-v4_0_0.xsd">
                 <parent>
                    <artifactId>weld-examples-parent</artifactId>
                    <groupId>org.jboss.weld.examples</groupId>
                    <version>1.0.0-CR2</version>
                    <relativePath>../../pom.xml</relativePath>
                 </parent>
                 <modelVersion>4.0.0</modelVersion>
                 <groupId>org.jboss.weld.examples.se</groupId>
                 <artifactId>weld-se-hello-world</artifactId>
                 <packaging>jar</packaging>
                 <name>Hello World SE</name>
              
                 <profiles>
                    <profile>
                       <id>run</id>
                       <activation>
                          <property>
                             <name>run</name>
                          </property>
                       </activation>
                       <build>
                          <plugins>
                             <plugin>
                                <executions>
                                   <execution>
                                      <id>run</id>
                                      <phase>package</phase>
                                      <goals>
                                         <goal>java</goal>
                                      </goals>
                                   </execution>
                                </executions>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>exec-maven-plugin</artifactId>
                                <configuration>
                                   <mainClass>org.jboss.weld.environment.se.StartMain</mainClass>
                                   <arguments>
                                      <argument>${name}</argument>
                                   </arguments>
                                </configuration>
                             </plugin>
                          </plugins>
                       </build>
                    </profile>
                 </profiles>
              
                 <dependencies>
                    <dependency>
                       <groupId>org.jboss.weld</groupId>
                       <artifactId>weld-se</artifactId>
                    </dependency>
                    <dependency>
                       <groupId>org.jboss.weld</groupId>
                       <artifactId>weld-core</artifactId>
                       <scope>provided</scope>
                    </dependency>
                 </dependencies>
              
                 <build>
                    <plugins>
                       <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-eclipse-plugin</artifactId>
                          <configuration>
                             <!-- This is needed so that we get StartMain on the RunAs list -->
                             <useProjectReferences>false</useProjectReferences>
                          </configuration>
                       </plugin>
                       <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-jar-plugin</artifactId>
                          <configuration>
                             <archive>
                                <manifest>
                                   <mainClass>org.jboss.weld.environment.se.StartMain</mainClass>
                                </manifest>
                             </archive>
                          </configuration>
                       </plugin>
                    </plugins>
                 </build>
              
              
              </project>