Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeMidnight
languagebash
git checkout releaseCandidatemaster # check out current or upcoming minor release of IGB
git clean -d -f # remove untracked files after checking out a new branch

Note that when you switch branches, files present in the first branch that are not present in newly checked-out branch with remain - git won't delete them. Running the "git clean" command will remove them.

...

Note that the first time you build IGB, maven will download all third-party libraries (called "dependencies") required by the IGB project to a local cache on your computer. This means that first time you compile IGB, you must be connected to the internet.

 

 

Start a new maven project for your IGB App "Hello World"

If you're new to maven, we recommend you use NetBeans to create a new maven project.

  1. Select File > New Project
  2. Select Categories > Maven
  3. Select Projects > Java Application
  4. Fill in fields as shown below.
    1. Project Name - this will determine the ultimate artifact id for your App. You can enter anything you like here.
    2. Project Location - select your NetBeansProjects folder, same folder where you cloned the IGB project.
    3. Group id - enter com.lorainelab to match the example below
    4. Version - this is the first version of your App; enter 1.0.0 to match the example below
    5. Package - package affiliation of your App; enter com.lorainelab.plugin to match the example below
  5. Select Finish

Image Removed

 

Directory Structure

The Maven build system assumes that every Java project conforms to an expected directory structure. Here, the maven project includes

  • pom.xml - located at the top level of the project. In IGB, an App's pom.xml file specifies which services the App needs to import from the IGB code base as well as any 3rd party libraries used by your App.
  • src - contains source code, organized as shown. Every maven project contains src/main/java, which contains java packages organized as directories in the usual way. The example shows a single Java source code file/

To see the directory structure for your project in NetBeans, select the Files tab (next to the Projects tab).

Image Removed

Many Apps will include image files and other content. To include these, create a directory named "resources" at the same level as the pom.xml file, as seen in the image above.

Edit pom.xml

When you created the project, maven generated a default "pom.xml" file:

Image Removed

...

Directory Structure

The Maven build system assumes that every Java project conforms to an expected directory structure. Here, the maven project includes

  • pom.xml - located at the top level of the project. In IGB, an App's pom.xml file specifies which services the App needs to import from the IGB code base as well as any 3rd party libraries used by your App.
  • src - contains source code, organized as shown. Every maven project contains src/main/java, which contains java packages organized as directories in the usual way. The example shows a single Java source code file/

To see the directory structure for your project in NetBeans, select the Files tab (next to the Projects tab).

Image Added

Many Apps will include image files and other content. To include these, create a directory named "resources" at the same level as the pom.xml file, as seen in the image above.

...

pom.xml

Code Block
<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>
    <parent>
        <groupId>com.affymetrix</groupId>
        <artifactId>igb-project</artifactId>
        <version>9.0.0</version>
    </parent>
    <groupId>org.lorainelab.igb</groupId>
    <artifactId>org.lorainelab.igb.menu.api.example</artifactId>
    <version>1.0.0</version>
    <packaging>bundle</packaging>

    <name>IGB Menubar Extension</name>
    
    <dependencies>
        <dependency>
            <groupId>biz.aQute.bnd</groupId>
            <artifactId>bndlib</artifactId>
            <scope>provided</scope>
        </dependency>
          <dependency>
            <groupId>org.lorainelab.igb</groupId>
            <artifactId>org.lorainelab.igb.menu.api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>build plugin repository</id>
                        <goals>
                            <goal>
                                index
                            </goal>                       
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <obrRepository>${project.build.directory}</obrRepository>    
                            <mavenRepository>${project.build.directory}</mavenRepository>                      
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                       <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Import-Package>*</Import-Package>
                        <Export-Package/>
                        <Service-Component>*</Service-Component>
                    </instructions>
                </configuration>
            </plugin>     
        </plugins>
    </build>
</project>

 

Add parent tag

The parent tag specifies which version of IGB your new App is compatible with. It also enables your project to inherit configurations from the parent pom.xml file, which will save you time and effort.
To find out what to enter here, open the pom.xml file at the top level of your cloned IGB project. Enter the value of the version tag you find in the IGB project pom.xml.
For example, if the IGB pom.xml contains version tag equal to 8.6.0, enter

 

Code Block
languagexml
<parent>
     <groupId>com.affymetrix</groupId>
     <artifactId>igb-project</artifactId>
     <version>8.6.0</version>
</parent>


Find IGB version in IGB project pom.xml:


Edit packaging tag

...