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