[JBoss Tools Development] - How to Build JBoss Tools with Maven 3
by Nick Boldt
Nick Boldt [https://community.jboss.org/people/nickboldt] modified the document:
"How to Build JBoss Tools with Maven 3"
To view the document, visit: https://community.jboss.org/docs/DOC-47936
--------------------------------------------------------------
**
#Environment_Setup Environment Setup
***
#Prerequisistes Prerequisistes
***
#Maven_and_Java Maven and Java
***
#Maven_settings Maven settings
***
#Maven__Java_Memory_Configuration Maven & Java Memory Configuration
**
#Verify_or_Install Verify or Install?
**
#About_Target_Platform_and_related_profiles About Target Platform and related profiles
***
#Using_published_Target_Platform_definition_Recommended Using published Target Platform definition (Recommended)
***
#Or_getting_a_local_copy_of_the_Target_Platform Or, getting a local copy of the Target Platform
****
#Get_it Get it
*****
#_Download_TP_as_a_zip_and_install_it_by_yourself Download TP as a zip and install it by yourself
*****
#OR_use_Maven_to_build_it OR, use Maven to build it
****
#Use_it_as_a_Maven_mirror Use it as a Maven mirror
**
#Optional_Build_parent_and_target_platform (Optional) Build parent and target platform
**
#Building_Individual_Components_Locally_Via_Commandline Building Individual Components Locally Via Commandline
***
#Build_a_component_resolving_to_a_recent_aggregation_build_for_other_JBT_dependencies_Recommanded Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
***
#Build_a_component_resolving_to_the_latest_CI_builds_for_other_JBT_dependencies Build a component resolving to the latest CI builds for other JBT dependencies
***
#Build_a_component_along_with_all_its_dependencies_from_sources_bootstrap_build Build a component along with all its dependencies from sources ("bootstrap" build)
**
#Building_Everything_In_One_Build_Locally_Via_Commandline Building Everything In One Build Locally Via Commandline
**
#Building_Locally_In_Eclipse Building Locally In Eclipse
**
#Installation_Testing__making_sure_your_stuff_can_be_installed_ Installation Testing - making sure your stuff can be installed
**
#Adding_a_new_feature_or_plugin_to_an_existing_component Adding a new feature or plugin to an existing component
**
#Dealing_with_timeouts_for_tests Dealing with timeouts for tests
**
#Tips_and_tricks_for_making_BOTH_PDE_UI_and_headless_Maven_builds_happy Tips and tricks for making BOTH PDE UI and headless Maven builds happy
***
#Check_your_buildproperties Check your build.properties
***
#Check_your_manifestmf_dependencies Check your manifest.mf dependencies
+*This article is a replacement for its precursor, https://community.jboss.org/docs/DOC-16604 How to Build JBoss Tools 3.3 with Maven 3.*+
+*Note that this article only discusses building from trunk. To work with another branch, see http://learn.github.com/p/branching.html Learn.GitHub - Branching and Merging.*+
+
+
+*+Looking for how to build our documentation? See+ https://community.jboss.org/docs/DOC-13341 Building JBoss Tools Documentation.*+
+
+
+
+
h2. +Environment Setup+
h3. +Prerequisistes+
1. +Java 1.6 SDK+
2. +Maven 3.0.3+
3. +About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools) - *requires VPN access*+
4. +subversion client 1.6.X (should work with lower version as well, but newer versions may not work as expected)+
h3. +Maven and Java+
+Make sure your maven 3 is available by default and Java 1.6 is used.+
+
+
+mvn -version+
+
+
+should print out something like+
+
+
+*Apache Maven 3.0.3* (r1075438; 2011-02-28 12:31:09-0500)+
+*Java version: 1.6.0_25*, vendor: Sun Microsystems Inc.+
+*Java home: /usr/java/jdk1.6.0_25/jre*+
+Default locale: en_US, platform encoding: UTF-8+
+OS name: "linux", version: "2.6.42.3-2.fc15.x86_64", arch: "amd64", family: "unix"+
+
+
h3. +Maven settings+
+Follow https://community.jboss.org/docs/DOC-15170 these instructions to add reference to JBoss Repositories into your settings.xml. You'll also probably need access to the SNAPSHOT repository. So here is what you should see in your ~/.m2/settings.xml+
+
+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
....
<profiles>
....
<profile>
<id>jboss-default</id>
<repositories>
<!-- To resolve parent artifact -->
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<pluginRepositories>
<!-- To resolve parent artifact -->
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
<pluginRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>jboss-default</activeProfile>
...
</activeProfiles>
</settings>
+
+
+#+
+*What if Maven can't find the upstream artifacts in Nexus? / Building Parent Pom & Target Platforms Locally*+
+
+
+Sometimes, Maven can't find the upstream artifacts - parent pom, tycho plugins, minimum (Juno SR0) or maximum (Juno SR1 or later) target platforms. Or maybe you want to build them locally in order to see how Tycho builds them, or contribute a fix. To work around resolution problems, just build locally:+
+
+
cd /tmp;
git clone git clone git://github.com/jbosstools/jbosstools-maven-plugins.git
cd /tmp;
git clone git clone git://github.com/jbosstools/jbosstools-build.git
cd jbosstools-maven-plugins/tycho-plugins; mvn install; cd -
cd jbosstools-build/parent; mvn install; cd -
cd jbosstools-build/target-platforms; mvn install -Pjbosstools-minimum,jbosstools-maximum
+
+
h3. +Maven & Java Memory Configuration+
+
+
+To configure the amount of memory used by Maven, you can define MVN_OPTS as follows, either in the mvn / mvn.bat script you use to run Maven, or set as global environment variables. Here's how to do so for http://forums.fedoraforum.org/showthread.php?t=262465 Fedora, https://help.ubuntu.com/community/EnvironmentVariables Ubuntu, http://forums.techarena.in/windows-xp-support/1152405.htm Windows, http://www.digitaledgesw.com/node/31 OSX.+
+
+
+{code}+
+set MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m+
+{code}+
+
+
h2. +Verify or Install?+
++mvn verify+ will perform all build and test steps, but it won't install the bundles in your local repository. +mvn install+ does install in you local repository. When an eclipse-plugin is installed in your repo, it is always used as default when resolving dependency. It is not possible to roll-back a local installation of a bundle, so in most cases, +mvn verify+ is to be prefered to +mvn install+. However, if you want to build stuff sequentially through several maven invocations, and you want to resolve against just-built stuff, you'll need to use +mvn install+.+
+In this page, we'll encourage people to use *mvn verify* as much as possible to ensure *isolation*; but you can mvn install the same way if your use-case requires it.+
+
+
h2. +About Target Platform and related profiles+
+The target platform (TP) lists all dependencies (coming from Eclipse.or and other 3rd-party update sites) that are used by JBoss Tools. This target platform is materialized as an Eclipse p2 repository (formerly update-site) that is used during build to resolve dependencies. Target Platform is managed by JBoss Tools people, and only dependencies from this TP are allowed to be used in code.+
+If you need a new dependency in the TP, feel free to https://issues.jboss.org/secure/CreateIssueDetails!init.jspa?pid=10020&su... open a ticket to request it.+
+
+
+Here are several ways to build locally using this target platform. It's up to you to choose the one that match your needs:+
h3. +Using published Target Platform definition (Recommended)+
+unified.target refers to the dependency as published in the Target Platform repository.+
* +Pros:+* +No additional thing to do than invoking Maven+
* +Always up-to-date+
* +Cons: Speed - (to evaluate)+
+Consume it by adding* +-Punified.target+* to you Maven invocation command-line+
h3. +Or, getting a local copy of the Target Platform+
* +Pros: Speed ++++
* +Cons: Step to be repeated whenever https://github.com/jbosstools/jbosstools-build/tree/master/target-platforms target platforms change+
h4. +Get it+
h5. +Download TP as a zip and install it by yourself+
+
+
+You can either download the TP as a zip and unpack it into some folder on your disk. Just remember to update your #settings.xml settings.xml file to point at the location where you unpacked it.+
+
+
+You can get it with a browser or a command line tool such as wget or curl at the following url:+
+
+
+ http://download.jboss.org/jbosstools/updates/juno/SR0c/ http://download.jboss.org/jbosstools/updates/juno/SR0c/ http://download.jboss.org/jbosstools/updates/juno/SR0c/e420-wtp340.target... e420-wtp340.target.zip (current minimum TP)+
+ http://download.jboss.org/jbosstools/updates/juno/SR1a/ http://download.jboss.org/jbosstools/updates/juno/SR1a/ http://download.jboss.org/jbosstools/updates/juno/SR1a/e421-wtp341.target... e421-wtp341.target.zip (current maximum TP)+
+
+
+and then unzip it :+
+
+
+unzip *.target.zip -d /path/to/jbosstools-build/target-platforms/jbosstools-JunoSR0c/multiple/target/multiple.target.repo/+
+ or+
+unzip *.target.zip -d /path/to/jbosstools-build/target-platforms/jbosstools-JunoSR1a/multiple/target/multiple.target.repo/+
+
+
h5. +OR, use Maven to build it+
+See #maven-nexus-resolution-problems Building Parent Pom & Target Platforms Locally+
+#maven-nexus-resolution-problems #h4. Use it as a Maven mirror
Once you get the target platform available locally, you can use it instead of the remote sites to save time. For this, we can simply use Tycho target-platform mirroring: http://wiki.eclipse.org/Tycho/Target_Platform/Authentication_and_Mirrors#... http://wiki.eclipse.org/Tycho/Target_Platform/Authentication_and_Mirrors#...
As example, you can simply edit to your ~/.m2/settings.xml the definition of the repositories to mirror: (replace /home/hudson/static_build_env/jbds/.... by a path where your local repository actuaaly stands)
<settings>
<mirrors>
<!-- IMPORTANT: Sites in target platforms: must not have trailing slash! -->
<mirror>
<id>jenkins.jbosstools-JunoSR0c</id>
<mirrorOf> http://download.jboss.org/jbosstools/updates/juno/SR0c/REPO http://download.jboss.org/jbosstools/updates/juno/SR0c/REPO</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/target-platform_4.0.juno.SR0c/e420-wtp340.target/</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbosstools-JunoSR1a</id>
<mirrorOf> http://download.jboss.org/jbosstools/updates/juno/SR1a/REPO http://download.jboss.org/jbosstools/updates/juno/SR1a/REPO</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/target-platform_4.0.juno.SR1a/e421-wtp341.target/</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbdevstudio-JunoSR0c</id>
<mirrorOf> http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju... http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju...</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/jbds-target-platform_4.0.juno.SR0c/jbds600-e420-wtp340.target/</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbdevstudio-JunoSR1a</id>
<mirrorOf> http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju... http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju...</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/jbds-target-platform_4.0.juno.SR1a/jbds600-e421-wtp341.target/</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
</mirrors>
</settings>
h2. (Optional) Build parent and target platform
This step is only useful if you are actually working on the parent or the target platforms and want to test local changes. Otherwise, Maven will simply retrieve parent and TP definitions from *https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/ JBoss Nexus* to perform your build.
See #maven-nexus-resolution-problems Building Parent Pom & Target Platforms Locally
h2. Building Individual Components Locally Via Commandline
h3. Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
* Pros:* You build only your component
* You only need source for your component
* Speed to resolve deps: +
* You get generally the latest build for you component
* Cons:* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change. More risk to get out of sync than with the staging site.
Tracked by https://issues.jboss.org/browse/JBIDE-11516 https://issues.jboss.org/browse/JBIDE-11516
example:
*cd jbosstools-server*
mvn verify -P unified.target *-Pjbosstools-staging-aggregate*
h3. Build a component resolving to the latest CI builds for other JBT dependencies
* Pros:* You build only your component
* You only need source for your component
* You get generally the latest build for you component
* Cons* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change
* Speed to resolve deps: -
This profile is the one use for CI builds on Hudson.
*cd jbosstools-server*
mvn verify -P unified.target *-Pjbosstools-nightly-staging-composite*
h3. Build a component along with all its dependencies from sources ("bootstrap" build)
This will build exactly what you have locally
* Pros:* You are sure of the version of sources that is used for your JBT dependencies
* You don't loose time in resolving your JBT deps
* Cons:* You need sources for your dependencies too
* You often build more stuff that what you really want to test
cd ~/trunk/jbosstools-server
mvn verify -P unified.target -*Pbootstrap*
h2. Building Everything In One Build Locally Via Commandline
*LINUX / MAC USERS*
cd jbosstools-build
mvn clean install -gs ~/.m2/settings.xml | tee build.all.log.txt
(tee is a program that pipes console output to BOTH console and a file so you can watch the build AND keep a log.)
*WINDOWS USERS*
cd c:\trunk\jbosstools-build
mvn3 clean verify -gs file:///${user.home}/.m2/settings.xml
or
mvn3 clean verify -gs file:///${user.home}/.m2/settings.xml > build.all.log.txt
Remember to adjust your #settings.xml settings.xml file to specify where you have your local target platform mirror built (or where you downloaded & unpacked a target platform zip. Windows users, if you don't have a .m2 folder, see http://stackoverflow.com/questions/6081617/missing-maven-m2-folder this article.
h2. Building Locally In Eclipse
First, you must have installed m2eclipse into your Eclipse (or JBDS). You can install the currently supported version from this update site:
http://download.jboss.org/jbosstools/updates/indigo/ http://download.jboss.org/jbosstools/updates/indigo/
Next, start up Eclipse or JBDS and do *File > Import* to import the project(s) you already checked out from SVN above into your workspace.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Browse to where you have the project(s) checked out, and select a folder to import pom projects. In this case, I'm importing the parent pom (which refers to the target platform pom). Optionally, you can add these new projects to a working set to collect them in your Package Explorer view.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Once the project(s) are imported, you'll want to build them. You can either do *CTRL-SHIFT-X,M (Run Maven Build),* or right-click the project and select *Run As > Maven Build*. The following screenshots show how to configure a build job.
First, on the *Main* tab, set a *Name*, *Goals*, *Profile*(s), and add a *Parameter*. Or, if you prefer, put everything in the *Goals* field for simplicity:
+clean install -B -fae -e+
Be sure to check *Resolve Workspace artifacts*, and, if you have a newer version of Maven installed, point your build at that *Maven Runtime* instead of the bundled one that ships with m2eclipse.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *JRE* tab, make sure you're using a 6.0 JDK.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Refresh* tab, define which workspace resources you want to refresh when the build's done.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Common* tab, you can store the output of the build in a log file in case it's particularly long and you need to refer back to it.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Click *Run* to run the build.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Now you can repeat the above step to build any other component or plugin or feature or update site from the JBoss Tools repo. Simply import the project(s) and build them as above.
h2. Installation Testing - making sure your stuff can be installed
Each component, when built, produces a update site zip and an unpacked update site which can be used to install your freshly-built features and plugins into a running Eclipse or JBDS instance.
Simply point your Eclipse at that folder or zip, eg., jar:file:/home/rob/code/jbtools/jbosstools-server/site/target/server.site-*.zip! or file:///home/rob/code/jbtools/jbosstools-server/site/target/repository/, and browse the site. If your component requires other upstream components to install, eg., jbosstools-server depends on jbosstools-base, you will also need to provide a URL from which Eclipse can resolve these missing dependencies. In order of freshness, you can use:
1. http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ (Nightly Trunk Site - updated every few hours or at least daily - *bleeding edge*)
2. http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ (Composite Staging Site - updated every time a component respins - *bleedinger edge*)
3. http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ (see the README.txt for how to use this site to refer to things you built locally - *bleedingest edge*)
h2. Adding a new feature or plugin to an existing component
Need to tweak a component to add a new plugin or feature? See https://community.jboss.org/docs/DOC-18373 https://community.jboss.org/wiki/AddingAPluginandorFeatureToAnExistingCom....
h2. Dealing with timeouts for tests
(To be rewritten soon...) http://lists.jboss.org/pipermail/jbosstools-dev/2012-September/005835.html http://lists.jboss.org/pipermail/jbosstools-dev/2012-September/005835.html
h2. Tips and tricks for making BOTH PDE UI and headless Maven builds happy
It's fairly common to have plugins compiling in eclipse while tycho would not work. Basically you could say that tycho is far more picky compared to Eclipse PDE.
h3.
Check your build.properties
Check build.properties in your plugin. If it has warnings in Eclipse, you'll most likely end with tycho failing to compile your sources. You'll have to make sure that you correct all warnings.
Especially check your build.properties to have entries for *source..* and *output..* -- these are needed to *http://wiki.eclipse.org/Minerva#Source generate source plugins and features*.
*
*
source.. = src/
output.. = bin/
src.includes = *
src.excludes = src
bin.includes = <your own,\
list of,\
files for inclusion,\
in the jar>
h3. Check your manifest.mf dependencies
A new issue when building against juno shows that all compilation dependencies MUST be EXPLICITLY mentioned in your manifest.mf list of dependencies. A recent example of how this can cause compilation errors is the archives module, which failed to build due to the org.eclipse.ui.views plugin, and its IPropertySheetPage interface, not being found during the build. After investigation, it was discovered that the archives.ui plugin did not explicitly declare a dependency on org.eclipse.ui.views.
Inside eclipse and during indigo builds, however, the depencency was found and there were no compilation errors. This was because a plugin archives.ui explicitly dependend on (org.eclipse.ui.ide) had an explicit dependency on org.eclipse.ui.views. The IDE was able to see that archives.ui dependended on org.eclipse.ui.ide, and org.eclipse.ui.ide depended on org.eclipse.ui.views.
Resolving nested dependencies no longer seems to be guaranteed, and so anything you have a compilation dependency on must now be explicitly declared in your manifest.mf
+
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47936]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
10 years, 6 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven 3
by Nick Boldt
Nick Boldt [https://community.jboss.org/people/nickboldt] modified the document:
"How to Build JBoss Tools with Maven 3"
To view the document, visit: https://community.jboss.org/docs/DOC-47936
--------------------------------------------------------------
**
#Environment_Setup Environment Setup
***
#Prerequisistes Prerequisistes
***
#Maven_and_Java Maven and Java
***
#Maven_settings Maven settings
***
#Maven__Java_Memory_Configuration Maven & Java Memory Configuration
**
#Verify_or_Install_ Verify or Install ?
**
#About_Target_Platform_and_related_profiles About Target Platform and related profiles
***
#Using_published_Target_Platform_definition_Recommanded Using published Target Platform definition (Recommanded)
***
#Or_getting_a_local_copy_of_the_Target_Platform Or, getting a local copy of the Target Platform
****
#Get_it Get it
*****
#_Download_TP_as_a_zip_and_install_it_by_yourself Download TP as a zip and install it by yourself
*****
#OR_use_Maven_to_build_it OR, use Maven to build it
****
#Use_it_as_a_Maven_mirror Use it as a Maven mirror
**
#Optional_Build_parent_and_target_platform (Optional) Build parent and target platform
**
#Building_Individual_Components_Locally_Via_Commandline Building Individual Components Locally Via Commandline
***
#Build_a_component_resolving_to_a_recent_aggregation_build_for_other_JBT_dependencies_Recommanded Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
***
#Build_a_component_resolving_to_the_latest_CI_builds_for_other_JBT_dependencies Build a component resolving to the latest CI builds for other JBT dependencies
***
#Build_a_component_along_with_all_its_dependencies_from_sources_bootstrap_build Build a component along with all its dependencies from sources ("bootstrap" build)
**
#Building_Everything_In_One_Build_Locally_Via_Commandline Building Everything In One Build Locally Via Commandline
**
#Building_Locally_In_Eclipse Building Locally In Eclipse
**
#Installation_Testing__making_sure_your_stuff_can_be_installed_ Installation Testing - making sure your stuff can be installed
**
#Adding_a_new_feature_or_plugin_to_an_existing_component Adding a new feature or plugin to an existing component
**
#Dealing_with_timeouts_for_tests Dealing with timeouts for tests
**
#Tips_and_tricks_for_making_BOTH_PDE_UI_and_headless_Maven_builds_happy Tips and tricks for making BOTH PDE UI and headless Maven builds happy
***
#Check_your_buildproperties Check your build.properties
***
#Check_your_manifestmf_dependencies Check your manifest.mf dependencies
+*This article is a replacement for its precursor, https://community.jboss.org/docs/DOC-16604 How to Build JBoss Tools 3.3 with Maven 3.*+
+*Note that this article only discusses building from trunk. If you need to build from a branch, or switch between branches and/or trunk, see* https://community.jboss.org/docs/DOC-17497 How to Build JBoss Tools With Maven3 - Working With Branches+*.*
*+Looking for how to build our documentation? See+ https://community.jboss.org/docs/DOC-13341 Building JBoss Tools Documentation.*
h2. Environment Setup
h3. Prerequisistes
1. Java 1.6 SDK
2. Maven 3.0.3
3. About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools) - *requires VPN access*
4. subversion client 1.6.X (should work with lower version as well, but newer versions may not work as expected)
h3. Maven and Java
Make sure your maven 3 is available by default and Java 1.6 is used.
mvn -version
should print out something like
*Apache Maven 3.0.3* (r1075438; 2011-02-28 12:31:09-0500)
*Java version: 1.6.0_25*, vendor: Sun Microsystems Inc.
*Java home: /usr/java/jdk1.6.0_25/jre*
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.42.3-2.fc15.x86_64", arch: "amd64", family: "unix"
h3. Maven settings
Follow https://community.jboss.org/docs/DOC-15170 these instructions to add reference to JBoss Repositories into your settings.xml. You'll also probably need access to the SNAPSHOT repository. So here is what you should see in your ~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
....
<profiles>
....
<profile>
<id>jboss-default</id>
<repositories>
<!-- To resolve parent artifact -->
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<pluginRepositories>
<!-- To resolve parent artifact -->
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
<pluginRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>jboss-default</activeProfile>
...
</activeProfiles>
</settings>
#
*What if Maven can't find the upstream artifacts in Nexus?*
Sometimes, Maven can't find the upstream artifacts - parent pom, tycho plugins, minimum (Juno SR0) or maximum (Juno SR1 or later) target platforms. To work around this, just build them locally:
cd /tmp; svn co http://anonsvn.jboss.org/repos/jbosstools/trunk/build/
mvn install -U -f build/parent/pom.xml
mvn install -U -f build/tycho-plugins/pom.xml
mvn install -U -f build/target-platforms/pom.xml -Pjbosstools-maximum,jbosstools-minimum
h3. Maven & Java Memory Configuration
To configure the amount of memory used by Maven, you can define MVN_OPTS as follows, either in the mvn / mvn.bat script you use to run Maven, or set as global environment variables. Here's how to do so for http://forums.fedoraforum.org/showthread.php?t=262465 Fedora, https://help.ubuntu.com/community/EnvironmentVariables Ubuntu, http://forums.techarena.in/windows-xp-support/1152405.htm Windows, http://www.digitaledgesw.com/node/31 OSX.
{code}
set MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
{code}
h2. Verify or Install ?
+mvn verify+ will perform all build and test steps, but it won't install the bundles in your local repository. +mvn install+ does install in you local repository. When an eclipse-plugin is installed in your repo, it is always used as default when resolving dependency. It is not possible to roll-back a local installation of a bundle, so in most cases, +mvn verify+ is to be prefered to +mvn install+. However, if you want to build stuff sequentially through several maven invocations, and you want to resolve against just-built stuff, you'll need to use +mvn install+.
In this page, we'll encourage people to use *mvn verify* as much as possible to ensure *isolation*; but you can mvn install the same way if your use-case requires it.
h2. About Target Platform and related profiles
The target platform (TP) lists all dependencies (coming from Eclipse.or and other 3rd-party update sites) that are used by JBoss Tools. This target platform is materialized as an Eclipse p2 repository (formerly update-site) that is used during build to resolve dependencies. Target Platform is managed by JBoss Tools people, and only dependencies from this TP are allowed to be used in code.
If you need a new dependency in the TP, feel free to https://issues.jboss.org/secure/CreateIssueDetails!init.jspa?pid=10020&su... open a ticket to request it.
Here are several ways to build locally using this target platform. It's up to you to choose the one that match your needs:
h3. Using published Target Platform definition (Recommanded)
unified.target refers to the dependency as published in the Target Platfrom repository.
* Pros:* No additional thing to do than invoking Maven
* Always up-to-date
* Cons: Speed - (to evaluate)
Consume it by adding* +-Punified.target+* to you Maven invocation command-line
h3. Or, getting a local copy of the Target Platform
* Pros: Speed +++
* Cons: Step to be repeated whenever https://source.jboss.org/browse/JBossTools/trunk/build/target-platform/un... target platform changes
h4. Get it
h5. Download TP as a zip and install it by yourself
You can either download the TP as a zip and unpack it into some folder on your disk. Just remember to update your #settings.xml settings.xml file to point at the location where you unpacked it.
You can get it with a browser or a command line tool such as wget or curl at the following url:
http://download.jboss.org/jbosstools/updates/juno/SR0c/ http://download.jboss.org/jbosstools/updates/juno/SR0c/ http://download.jboss.org/jbosstools/updates/juno/SR0c/e420-wtp340.target... e420-wtp340.target.zip (current minimum TP)
http://download.jboss.org/jbosstools/updates/juno/SR1a/ http://download.jboss.org/jbosstools/updates/juno/SR1a/ http://download.jboss.org/jbosstools/updates/juno/SR1a/e421-wtp341.target... e421-wtp341.target.zip (current maximum TP)
and then unzip it :
unzip *.target.zip -d /path/to/jbosstools-build/target-platforms/jbosstools-JunoSR0c/multiple/target/multiple.target.repo/
or
unzip *.target.zip -d /path/to/jbosstools-build/target-platforms/jbosstools-JunoSR1a/multiple/target/multiple.target.repo/
h5. OR, use Maven to build it
Starting from https://github.com/jbosstools/jbosstools-build/ jbosstools-build:
cd target-platforms/<choose_a_target_to_build>/multiple
mvn install
By default, a Maven profile +multiple2repo+ is enabled. You can see the result repo in +target/multiple.target.repo+. This output repo can be used as a mirror for unified.target. It may take a while, so you're better off from a speed point-of-view simply fetching the latest zip [5]. However, if you want to see what actually happens to create the TP (as done in Hudson) this is the approach to take.
#
h4. Use it as a Maven mirror
Once you get the target platform available locally, you can use it instead of the remote sites to save time. For this, we can simply use Tycho target-platform mirroring: http://wiki.eclipse.org/Tycho/Target_Platform/Authentication_and_Mirrors#... http://wiki.eclipse.org/Tycho/Target_Platform/Authentication_and_Mirrors#...
As example, you can simply edit to your ~/.m2/settings.xml the definition of the repositories to mirror: (replace /home/hudson/static_build_env/jbds/.... by a path where your local repository actuaaly stands)
<settings>
<mirrors>
<!-- IMPORTANT: Sites in target platforms: must not have trailing slash! -->
<mirror>
<id>jenkins.jbosstools-JunoSR0c</id>
<mirrorOf>http://download.jboss.org/jbosstools/updates/juno/SR0c/REPO</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/target-platform_4.0.juno.SR0c/e420-wtp340.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbosstools-JunoSR1a</id>
<mirrorOf>http://download.jboss.org/jbosstools/updates/juno/SR1a/REPO</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/target-platform_4.0.juno.SR1a/e421-wtp341.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbdevstudio-JunoSR0c</id>
<mirrorOf>http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju...</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/jbds-target-platform_4.0.juno.SR0c/jbds600-e420-wtp340.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbdevstudio-JunoSR1a</id>
<mirrorOf>http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju...</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/jbds-target-platform_4.0.juno.SR1a/jbds600-e421-wtp341.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
</mirrors>
</settings>
h2. (Optional) Build parent and target platform
This step is only useful if you are actually working on the parent or the target platform and want to test it locally. Otherwise, Maven will simply retrieve parent and TP from *https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/ JBoss Nexus* to perform your build.
This is only necessary when the TP change, prior to 3.3.Beta3
svn co http://svn.jboss.org/repos/jbosstools/trunk jbosstools
cd jbosstools-build/parent
mvn clean install
...
[INFO] Reactor Summary:
[INFO]
[INFO] JBoss Tools Target Platform Definition ............ SUCCESS [0.724s]
[INFO] JBoss Tools Parent ................................ SUCCESS [0.461s]
...
*NOTE: You need not fetch the entire JBoss Tools tree from SVN (or Git (http://divby0.blogspot.com/2011/01/howto-partially-clone-svn-repo-to-git....
*Instead, you can just fetch the build/ folder and one or more component folders, then as before,*
*build the parent pom. After that, go into the component folder and run maven there (#runmavenpercomponent).*
mkdir jbosstools
cd jbosstools
svn co http://svn.jboss.org/repos/jbosstools/trunk/ http://svn.jboss.org/repos/jbosstools/trunk/build
svn co http://svn.jboss.org/repos/jbosstools/trunk/ http://svn.jboss.org/repos/jbosstools/trunk/jmx
cd jbosstools-build/parent
mvn clean install
...
[INFO] Reactor Summary:
[INFO]
[INFO] JBoss Tools Target Platform Definition ............ SUCCESS [0.724s]
[INFO] JBoss Tools Parent ................................ SUCCESS [0.461s]
...
h2. Building Individual Components Locally Via Commandline
h3. Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
* Pros:* You build only your component
* You only need source for your component
* Speed to resolve deps: +
* You get generally the latest build for you component
* Cons:* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change. More risk to get out of sync than with the staging site.
Tracked by https://issues.jboss.org/browse/JBIDE-11516 https://issues.jboss.org/browse/JBIDE-11516
example:
*cd jmx*
mvn verify -P unified.target *-Pjbosstools-staging-aggregate*
h3. Build a component resolving to the latest CI builds for other JBT dependencies
* Pros:* You build only your component
* You only need source for your component
* You get generally the latest build for you component
* Cons* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change
* Speed to resolve deps: -
This profile is the one use for CI builds on Hudson.
*cd jmx*
mvn verify -P unified.target *-Pjbosstools-nightly-staging-composite*
h3. Build a component along with all its dependencies from sources ("bootstrap" build)
This will build exactly what you have locally
* Pros:* You are sure of the version of sources that is used for your JBT dependencies
* You don't loose time in resolving your JBT deps
* Cons:* You need sources for your dependencies too
* You often build more stuff that what you really want to test
*TODO: THIS NEEDS TO BE REWRITTEN SINCE WE ARE IN GITHUB NOW*
cd ~/trunk/jbosstools-build
mvn verify -P unified.target -*P jmx-bootstrap*
h2. Building Everything In One Build Locally Via Commandline
*LINUX / MAC USERS*
cd jbosstools-build
mvn clean install -gs ~/.m2/settings.xml | tee build.all.log.txt
(tee is a program that pipes console output to BOTH console and a file so you can watch the build AND keep a log.)
*WINDOWS USERS*
cd c:\trunk\jbosstools-build
mvn3 clean verify -P local.site -gs file:///${user.home}/.m2/settings.xml
or
mvn3 clean verify -Plocal.site -gs file:///${user.home}/.m2/settings.xml > build.all.log.txt
Remember to adjust your #settings.xml settings.xml file to specify where you have your local target platform mirror built (or where you downloaded & unpacked a target platform zip. Windows users, if you don't have a .m2 folder, see http://stackoverflow.com/questions/6081617/missing-maven-m2-folder this article.
h2. Building Locally In Eclipse
First, you must have installed m2eclipse into your Eclipse (or JBDS). You can install the currently supported version from this update site:
http://download.jboss.org/jbosstools/updates/indigo/ http://download.jboss.org/jbosstools/updates/indigo/
Next, start up Eclipse or JBDS and do *File > Import* to import the project(s) you already checked out from SVN above into your workspace.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Browse to where you have the project(s) checked out, and select a folder to import pom projects. In this case, I'm importing the parent pom (which refers to the target platform pom). Optionally, you can add these new projects to a working set to collect them in your Package Explorer view.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Once the project(s) are imported, you'll want to build them. You can either do *CTRL-SHIFT-X,M (Run Maven Build),* or right-click the project and select *Run As > Maven Build*. The following screenshots show how to configure a build job.
First, on the *Main* tab, set a *Name*, *Goals*, *Profile*(s), and add a *Parameter*. Or, if you prefer, put everything in the *Goals* field for simplicity:
+clean install -U -B -fae -e -Plocal.site -Dlocal.site=file://home/nboldt/tmp/JBT_REPO_Indigo/+
Be sure to check *Resolve Workspace artifacts*, and, if you have a newer version of Maven installed, point your build at that *Maven Runtime* instead of the bundled one that ships with m2eclipse.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *JRE* tab, make sure you're using a 6.0 JDK.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Refresh* tab, define which workspace resources you want to refresh when the build's done.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Common* tab, you can store the output of the build in a log file in case it's particularly long and you need to refer back to it.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Click *Run* to run the build.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Now you can repeat the above step to build any other component or plugin or feature or update site from the JBoss Tools repo. Simply import the project(s) and build them as above.
h2. Installation Testing - making sure your stuff can be installed
Each component, when built, produces a update site zip and an unpacked update site which can be used to install your freshly-built features and plugins into a running Eclipse or JBDS instance.
Simply point your Eclipse at that folder or zip, eg., jar:file:/home/rob/code/jbtools/jbosstools/trunk/runtime/site/target/runtime.site.zip! or file:///home/rob/code/jbtools/jbosstools/trunk/runtime/site/target/repository/, and browse the site. If your component requires other upstream components to install, eg., Runtime Detection depends on JBoss Common, you will also need to provide a URL from which Eclipse can resolve these missing dependencies. In order of freshness, you can use:
1. http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ (Nightly Trunk Site - updated every few hours or at least daily - *bleeding edge*)
2. http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ (Composite Staging Site - updated every time a component respins - *bleedinger edge*)
3. http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ (see the README.txt for how to use this site to refer to things you built locally - *bleedingest edge*)
h2. Adding a new feature or plugin to an existing component
Need to tweak a component to add a new plugin or feature? See https://community.jboss.org/docs/DOC-18373 https://community.jboss.org/wiki/AddingAPluginandorFeatureToAnExistingCom....
h2. Dealing with timeouts for tests
(To be rewritten soon...) http://lists.jboss.org/pipermail/jbosstools-dev/2012-September/005835.html http://lists.jboss.org/pipermail/jbosstools-dev/2012-September/005835.html
h2. Tips and tricks for making BOTH PDE UI and headless Maven builds happy
It's fairly common to have plugins compiling in eclipse while tycho would not work. Basically you could say that tycho is far more picky compared to Eclipse PDE.
h3.
Check your build.properties
Check build.properties in your plugin. If it has warnings in Eclipse, you'll most likely end with tycho failing to compile your sources. You'll have to make sure that you correct all warnings.
Especially check your build.properties to have entries for *source..* and *output..* -- these are needed to *http://wiki.eclipse.org/Minerva#Source generate source plugins and features*.
*
*
source.. = src/
output.. = bin/
src.includes = *
src.excludes = src
bin.includes = <your own,\
list of,\
files for inclusion,\
in the jar>
h3. Check your manifest.mf dependencies
A new issue when building against juno shows that all compilation dependencies MUST be EXPLICITLY mentioned in your manifest.mf list of dependencies. A recent example of how this can cause compilation errors is the archives module, which failed to build due to the org.eclipse.ui.views plugin, and its IPropertySheetPage interface, not being found during the build. After investigation, it was discovered that the archives.ui plugin did not explicitly declare a dependency on org.eclipse.ui.views.
Inside eclipse and during indigo builds, however, the depencency was found and there were no compilation errors. This was because a plugin archives.ui explicitly dependend on (org.eclipse.ui.ide) had an explicit dependency on org.eclipse.ui.views. The IDE was able to see that archives.ui dependended on org.eclipse.ui.ide, and org.eclipse.ui.ide depended on org.eclipse.ui.views.
Resolving nested dependencies no longer seems to be guaranteed, and so anything you have a compilation dependency on must now be explicitly declared in your manifest.mf
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47936]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
10 years, 6 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven 3
by Nick Boldt
Nick Boldt [https://community.jboss.org/people/nickboldt] created the document:
"How to Build JBoss Tools with Maven 3"
To view the document, visit: https://community.jboss.org/docs/DOC-47936
--------------------------------------------------------------
**
#Environment_Setup Environment Setup
***
#Prerequisistes Prerequisistes
***
#Maven_and_Java Maven and Java
***
#Maven_settings Maven settings
***
#Maven__Java_Memory_Configuration Maven & Java Memory Configuration
**
#Verify_or_Install_ Verify or Install ?
**
#About_Target_Platform_and_related_profiles About Target Platform and related profiles
***
#Using_published_Target_Platform_definition_Recommanded Using published Target Platform definition (Recommanded)
***
#Or_getting_a_local_copy_of_the_Target_Platform Or, getting a local copy of the Target Platform
****
#Get_it Get it
*****
#_Download_TP_as_a_zip_and_install_it_by_yourself Download TP as a zip and install it by yourself
*****
#OR_use_Maven_to_get_it OR, use Maven to get it
****
#Use_it_as_Maven_mirror Use it as Maven mirror
**
#Optional_Build_parent_and_target_platform (Optional) Build parent and target platform
**
#Building_Individual_Components_Locally_Via_Commandline Building Individual Components Locally Via Commandline
***
#Build_a_component_resolving_to_a_recent_aggregation_build_for_other_JBT_dependencies_Recommanded Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
***
#Build_a_component_resolving_to_the_latest_CI_builds_for_other_JBT_dependencies Build a component resolving to the latest CI builds for other JBT dependencies
***
#Build_a_component_along_with_all_its_dependencies_from_sources_bootstrap_build Build a component along with all its dependencies from sources ("bootstrap" build)
**
#Building_Everything_In_One_Build_Locally_Via_Commandline Building Everything In One Build Locally Via Commandline
**
#Building_Locally_In_Eclipse Building Locally In Eclipse
**
#Installation_Testing__making_sure_your_stuff_can_be_installed_ Installation Testing - making sure your stuff can be installed
**
#Adding_a_new_feature_or_plugin_to_an_existing_component Adding a new feature or plugin to an existing component
**
#Dealing_with_timeouts_for_tests Dealing with timeouts for tests
**
#Tips_and_tricks_for_making_BOTH_PDE_UI_and_headless_Maven_builds_happy Tips and tricks for making BOTH PDE UI and headless Maven builds happy
***
#Check_your_buildproperties Check your build.properties
***
#Check_your_manifestmf_dependencies Check your manifest.mf dependencies
+*This article is a replacement for its precursor, https://community.jboss.org/docs/DOC-15513 How to Build JBoss Tools 3.2 with Maven 3.*+
+*Note that this article only discusses building from trunk. If you need to build from a branch, or switch between branches and/or trunk, see* https://community.jboss.org/docs/DOC-17497 How to Build JBoss Tools With Maven3 - Working With Branches+*.*
*+Looking for how to build our documentation? See+ https://community.jboss.org/docs/DOC-13341 Building JBoss Tools Documentation.*
h2. Environment Setup
h3. Prerequisistes
1. Java 1.6 SDK
2. Maven 3.0.3
3. About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools) - *requires VPN access*
4. subversion client 1.6.X (should work with lower version as well, but newer versions may not work as expected)
h3. Maven and Java
Make sure your maven 3 is available by default and Java 1.6 is used.
mvn -version
should print out something like
*Apache Maven 3.0.3* (r1075438; 2011-02-28 12:31:09-0500)
*Java version: 1.6.0_25*, vendor: Sun Microsystems Inc.
*Java home: /usr/java/jdk1.6.0_25/jre*
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.42.3-2.fc15.x86_64", arch: "amd64", family: "unix"
h3. Maven settings
Follow https://community.jboss.org/docs/DOC-15170 these instructions to add reference to JBoss Repositories into your settings.xml. You'll also probably need access to the SNAPSHOT repository. So here is what you should see in your ~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
....
<profiles>
....
<profile>
<id>jboss-default</id>
<repositories>
<!-- To resolve parent artifact -->
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<pluginRepositories>
<!-- To resolve parent artifact -->
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
<pluginRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>jboss-default</activeProfile>
...
</activeProfiles>
</settings>
#
*What if Maven can't find the upstream artifacts in Nexus?*
Sometimes, Maven can't find the upstream artifacts - parent pom, tycho plugins, minimum (Juno SR0) or maximum (Juno SR1 or later) target platforms. To work around this, just build them locally:
cd /tmp; svn co http://anonsvn.jboss.org/repos/jbosstools/trunk/build/
mvn install -U -f build/parent/pom.xml
mvn install -U -f build/tycho-plugins/pom.xml
mvn install -U -f build/target-platforms/pom.xml -Pjbosstools-maximum,jbosstools-minimum
h3. Maven & Java Memory Configuration
To configure the amount of memory used by Maven, you can define MVN_OPTS as follows, either in the mvn / mvn.bat script you use to run Maven, or set as global environment variables. Here's how to do so for http://forums.fedoraforum.org/showthread.php?t=262465 Fedora, https://help.ubuntu.com/community/EnvironmentVariables Ubuntu, http://forums.techarena.in/windows-xp-support/1152405.htm Windows, http://www.digitaledgesw.com/node/31 OSX.
{code}
set MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
{code}
h2. Verify or Install ?
+mvn verify+ will perform all build and test steps, but it won't install the bundles in your local repository. +mvn install+ does install in you local repository. When an eclipse-plugin is installed in your repo, it is always used as default when resolving dependency. It is not possible to roll-back a local installation of a bundle, so in most cases, +mvn verify+ is to be prefered to +mvn install+. However, if you want to build stuff sequentially through several maven invocations, and you want to resolve against just-built stuff, you'll need to use +mvn install+.
In this page, we'll encourage people to use *mvn verify* as much as possible to ensure *isolation*; but you can mvn install the same way if your use-case requires it.
h2. About Target Platform and related profiles
The target platform (TP) lists all dependencies (coming from Eclipse.or and other 3rd-party update sites) that are used by JBoss Tools. This target platform is materialized as an Eclipse p2 repository (formerly update-site) that is used during build to resolve dependencies. Target Platform is managed by JBoss Tools people, and only dependencies from this TP are allowed to be used in code.
If you need a new dependency in the TP, feel free to https://issues.jboss.org/secure/CreateIssueDetails!init.jspa?pid=10020&su... open a ticket to request it.
Here are several ways to build locally using this target platform. It's up to you to choose the one that match your needs:
h3. Using published Target Platform definition (Recommanded)
unified.target refers to the dependency as published in the Target Platfrom repository.
* Pros:* No additional thing to do than invoking Maven
* Always up-to-date
* Cons: Speed - (to evaluate)
Consume it by adding* +-Punified.target+* to you Maven invocation command-line
h3. Or, getting a local copy of the Target Platform
* Pros: Speed +++
* Cons: Step to be repeated whenever https://source.jboss.org/browse/JBossTools/trunk/build/target-platform/un... target platform changes
h4. Get it
h5. Download TP as a zip and install it by yourself
You can either download the TP as a zip and unpack it into some folder on your disk. For convenience, the easiest is to unzip into jbosstools/build/target-platform/REPO/, since that's where the Maven or Ant process will by default operate.
You can get it with a browser or a command line tool such as wget or curl at the following url:
http://download.jboss.org/jbosstools/updates/juno/SR0c/ http://download.jboss.org/jbosstools/updates/juno/SR0c/ http://download.jboss.org/jbosstools/updates/juno/SR0c/e420-wtp340.target... e420-wtp340.target.zip (current minimum TP)
http://download.jboss.org/jbosstools/updates/juno/SR1a/ http://download.jboss.org/jbosstools/updates/juno/SR1a/ http://download.jboss.org/jbosstools/updates/juno/SR1a/e421-wtp341.target... e421-wtp341.target.zip (current maximum TP)
and then unzip it :
unzip *.target.zip -d /path/to/my jbosstools/build/target-platforms/jbosstools-JunoSR0c/local/target/REPO/
or
unzip *.target.zip -d /path/to/my jbosstools/build/target-platforms/jbosstools-JunoSR1a/local/target/REPO/
*(Note that the default path used for <local.site> will change every time a new target platform is released which is a significant change over the previous (eg., SR1, SR2), so if this breaks because the default not points at an empty folder, it's time to get a new TP! Hurray for build-time notification you're using an old target platform!)*
h5. OR, use Maven to get it
Starting from jbosstools-builds:
cd target-platforms/<choose_a_target_to_build>/multiple
mvn install
By default, a Maven profile +multiple2repo+ is enabled. You can see the result repo in target/multiple.target.repo. This output repo can be used as a mirror for unified.target. It may take a while, so you're better off from a speed point-of-view simply fetching the latest zip [5]. However, if you want to see what actually happens to create the TP (as done in Hudson) this is the approach to take.
h4. Use it as Maven mirror
Once you get the target platform available locally, you can use it instead of the remote sites to save time. For this, we can simply use Tycho target-platform mirroring: http://wiki.eclipse.org/Tycho/Target_Platform/Authentication_and_Mirrors#... http://wiki.eclipse.org/Tycho/Target_Platform/Authentication_and_Mirrors#...
As example, you can simply edit to your ~/.m2/settings.xml the definition of the repositories to mirror: (replace /ho,e/hudson/static_build_env/jbds/.... by a path where your local repository actuaaly stands)
<settings>
<mirrors>
<!-- IMPORTANT: Sites in target platforms: must not have trailing slash! -->
<mirror>
<id>jenkins.jbosstools-JunoSR0c</id>
<mirrorOf>http://download.jboss.org/jbosstools/updates/juno/SR0c/REPO</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/target-platform_4.0.juno.SR0c/e420-wtp340.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbosstools-JunoSR1a</id>
<mirrorOf>http://download.jboss.org/jbosstools/updates/juno/SR1a/REPO</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/target-platform_4.0.juno.SR1a/e421-wtp341.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbdevstudio-JunoSR0c</id>
<mirrorOf>http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju...</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/jbds-target-platform_4.0.juno.SR0c/jbds600-e420-wtp340.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
<mirror>
<id>jenkins.jbdevstudio-JunoSR1a</id>
<mirrorOf>http://www.qa.jboss.com/binaries/RHDS/updates/jbds-target-platform_4.0.ju...</mirrorOf>
<url>file:///home/hudson/static_build_env/jbds/jbds-target-platform_4.0.juno.SR1a/jbds600-e421-wtp341.target</url>
<layout>p2</layout>
<mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>
</mirrors>
</settings>
h2. (Optional) Build parent and target platform
This step is only useful if you are actually working on the parent or the target platform and want to test it locally. Otherwise, Maven will simply retrieve parent and TP from *https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/ JBoss Nexus* to perform your build.
This is only necessary when the TP change, prior to 3.3.Beta3
svn co http://svn.jboss.org/repos/jbosstools/trunk jbosstools
cd jbosstools/build/parent
mvn clean install
...
[INFO] Reactor Summary:
[INFO]
[INFO] JBoss Tools Target Platform Definition ............ SUCCESS [0.724s]
[INFO] JBoss Tools Parent ................................ SUCCESS [0.461s]
...
*NOTE: You need not fetch the entire JBoss Tools tree from SVN (or Git (http://divby0.blogspot.com/2011/01/howto-partially-clone-svn-repo-to-git....
*Instead, you can just fetch the build/ folder and one or more component folders, then as before,*
*build the parent pom. After that, go into the component folder and run maven there (#runmavenpercomponent).*
mkdir jbosstools
cd jbosstools
svn co http://svn.jboss.org/repos/jbosstools/trunk/ http://svn.jboss.org/repos/jbosstools/trunk/build
svn co http://svn.jboss.org/repos/jbosstools/trunk/ http://svn.jboss.org/repos/jbosstools/trunk/jmx
cd jbosstools/build/parent
mvn clean install
...
[INFO] Reactor Summary:
[INFO]
[INFO] JBoss Tools Target Platform Definition ............ SUCCESS [0.724s]
[INFO] JBoss Tools Parent ................................ SUCCESS [0.461s]
...
h2. Building Individual Components Locally Via Commandline
h3. Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
* Pros:* You build only your component
* You only need source for your component
* Speed to resolve deps: +
* You get generally the latest build for you component
* Cons:* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change. More risk to get out of sync than with the staging site.
Tracked by https://issues.jboss.org/browse/JBIDE-11516 https://issues.jboss.org/browse/JBIDE-11516
example:
*cd jmx*
mvn verify -P unified.target *-Pjbosstools-staging-aggregate*
h3. Build a component resolving to the latest CI builds for other JBT dependencies
* Pros:* You build only your component
* You only need source for your component
* You get generally the latest build for you component
* Cons* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change
* Speed to resolve deps: -
This profile is the one use for CI builds on Hudson.
*cd jmx*
mvn verify -P unified.target *-Pjbosstools-nightly-staging-composite*
h3. Build a component along with all its dependencies from sources ("bootstrap" build)
This will build exactly what you have locally
* Pros:* You are sure of the version of sources that is used for your JBT dependencies
* You don't loose time in resolving your JBT deps
* Cons:* You need sources for your dependencies too
* You often build more stuff that what you really want to test
cd ~/trunk/build
mvn verify -P unified.target -*P jmx-bootstrap*
h2. Building Everything In One Build Locally Via Commandline
Assuming you have a local copy of the target platform in ${HOME}/trunk/build/target-platform/REPO/ (as explained previously:
*LINUX / MAC USERS*
cd build
mvn clean install -P local.site -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ | tee build.all.log.txt
(tee is a program that pipes console output to BOTH console and a file so you can watch the build AND keep a log.)
*WINDOWS USERS*
cd c:\trunk\build
mvn3 clean verify -P local.site -Dlocal.site=file:///C:/trunk/build/target-platform/REPO/
or
mvn3 clean verify -Plocal.site -Dlocal.site=file:///C:/trunk/build/target-platform/REPO/ > build.all.log.txt
If you downloaded the zip and unpacked is somewhere else, use -Dlocal.site=file:///.../ to point at that folder instead
h2. Building Locally In Eclipse
First, you must have installed m2eclipse into your Eclipse (or JBDS). You can install the currently supported version from this update site:
http://download.jboss.org/jbosstools/updates/indigo/ http://download.jboss.org/jbosstools/updates/indigo/
Next, start up Eclipse or JBDS and do *File > Import* to import the project(s) you already checked out from SVN above into your workspace.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Browse to where you have the project(s) checked out, and select a folder to import pom projects. In this case, I'm importing the parent pom (which refers to the target platform pom). Optionally, you can add these new projects to a working set to collect them in your Package Explorer view.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Once the project(s) are imported, you'll want to build them. You can either do *CTRL-SHIFT-X,M (Run Maven Build),* or right-click the project and select *Run As > Maven Build*. The following screenshots show how to configure a build job.
First, on the *Main* tab, set a *Name*, *Goals*, *Profile*(s), and add a *Parameter*. Or, if you prefer, put everything in the *Goals* field for simplicity:
+clean install -U -B -fae -e -Plocal.site -Dlocal.site=file://home/nboldt/tmp/JBT_REPO_Indigo/+
Be sure to check *Resolve Workspace artifacts*, and, if you have a newer version of Maven installed, point your build at that *Maven Runtime* instead of the bundled one that ships with m2eclipse.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *JRE* tab, make sure you're using a 6.0 JDK.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Refresh* tab, define which workspace resources you want to refresh when the build's done.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Common* tab, you can store the output of the build in a log file in case it's particularly long and you need to refer back to it.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Click *Run* to run the build.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-62-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Now you can repeat the above step to build any other component or plugin or feature or update site from the JBoss Tools repo. Simply import the project(s) and build them as above.
h2. Installation Testing - making sure your stuff can be installed
Each component, when built, produces a update site zip and an unpacked update site which can be used to install your freshly-built features and plugins into a running Eclipse or JBDS instance.
Simply point your Eclipse at that folder or zip, eg., jar:file:/home/rob/code/jbtools/jbosstools/trunk/runtime/site/target/runtime.site.zip! or file:///home/rob/code/jbtools/jbosstools/trunk/runtime/site/target/repository/, and browse the site. If your component requires other upstream components to install, eg., Runtime Detection depends on JBoss Common, you will also need to provide a URL from which Eclipse can resolve these missing dependencies. In order of freshness, you can use:
1. http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ (Nightly Trunk Site - updated every few hours or at least daily - *bleeding edge*)
2. http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ (Composite Staging Site - updated every time a component respins - *bleedinger edge*)
3. http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ (see the README.txt for how to use this site to refer to things you built locally - *bleedingest edge*)
h2. Adding a new feature or plugin to an existing component
Need to tweak a component to add a new plugin or feature? See https://community.jboss.org/docs/DOC-18373 https://community.jboss.org/wiki/AddingAPluginandorFeatureToAnExistingCom....
h2. Dealing with timeouts for tests
(To be rewritten soon...) http://lists.jboss.org/pipermail/jbosstools-dev/2012-September/005835.html http://lists.jboss.org/pipermail/jbosstools-dev/2012-September/005835.html
h2. Tips and tricks for making BOTH PDE UI and headless Maven builds happy
It's fairly common to have plugins compiling in eclipse while tycho would not work. Basically you could say that tycho is far more picky compared to Eclipse PDE.
h3.
Check your build.properties
Check build.properties in your plugin. If it has warnings in Eclipse, you'll most likely end with tycho failing to compile your sources. You'll have to make sure that you correct all warnings.
Especially check your build.properties to have entries for *source..* and *output..* -- these are needed to *http://wiki.eclipse.org/Minerva#Source generate source plugins and features*.
*
*
source.. = src/
output.. = bin/
src.includes = *
src.excludes = src
bin.includes = <your own,\
list of,\
files for inclusion,\
in the jar>
h3. Check your manifest.mf dependencies
A new issue when building against juno shows that all compilation dependencies MUST be EXPLICITLY mentioned in your manifest.mf list of dependencies. A recent example of how this can cause compilation errors is the archives module, which failed to build due to the org.eclipse.ui.views plugin, and its IPropertySheetPage interface, not being found during the build. After investigation, it was discovered that the archives.ui plugin did not explicitly declare a dependency on org.eclipse.ui.views.
Inside eclipse and during indigo builds, however, the depencency was found and there were no compilation errors. This was because a plugin archives.ui explicitly dependend on (org.eclipse.ui.ide) had an explicit dependency on org.eclipse.ui.views. The IDE was able to see that archives.ui dependended on org.eclipse.ui.ide, and org.eclipse.ui.ide depended on org.eclipse.ui.views.
Resolving nested dependencies no longer seems to be guaranteed, and so anything you have a compilation dependency on must now be explicitly declared in your manifest.mf
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47936]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
10 years, 6 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven 3
by Nick Boldt
Nick Boldt [https://community.jboss.org/people/nickboldt] modified the document:
"How to Build JBoss Tools with Maven 3"
To view the document, visit: https://community.jboss.org/docs/DOC-16604
--------------------------------------------------------------
**
#Environment_Setup Environment Setup
***
#Prerequisistes Prerequisistes
***
#Maven_and_Java Maven and Java
***
#Maven_settings Maven settings
***
#Maven__Java_Memory_Configuration Maven & Java Memory Configuration
**
#Verify_or_Install_ Verify or Install ?
**
#About_Target_Platform_and_related_profiles About Target Platform and related profiles
***
#Using_published_Target_Platform_definition_Recommanded Using published Target Platform definition (Recommanded)
***
#Or_getting_a_local_copy_of_the_Target_Platform Or, getting a local copy of the Target Platform
****
#Set_up Set up
*****
#_Download_TP_as_a_zip_and_install_it_by_yourself Download TP as a zip and install it by yourself
*****
#OR_use_MavenAnt_to_get_it OR, use Maven+Ant to get it
****
#Use Use
**
#Optional_Build_parent_and_target_platform (Optional) Build parent and target platform
**
#Building_Individual_Components_Locally_Via_Commandline Building Individual Components Locally Via Commandline
***
#Build_a_component_resolving_to_a_recent_aggregation_build_for_other_JBT_dependencies_Recommanded Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
***
#Build_a_component_resolving_to_the_latest_CI_builds_for_other_JBT_dependencies Build a component resolving to the latest CI builds for other JBT dependencies
***
#Build_a_component_along_with_all_its_dependencies_from_sources_bootstrap_build Build a component along with all its dependencies from sources ("bootstrap" build)
**
#Building_Everything_In_One_Build_Locally_Via_Commandline Building Everything In One Build Locally Via Commandline
**
#Building_Locally_In_Eclipse Building Locally In Eclipse
**
#Installation_Testing__making_sure_your_stuff_can_be_installed_ Installation Testing - making sure your stuff can be installed
**
#Adding_a_new_feature_or_plugin_to_an_existing_component Adding a new feature or plugin to an existing component
**
#Tips_and_tricks_for_making_BOTH_PDE_UI_and_headless_Maven_builds_happy Tips and tricks for making BOTH PDE UI and headless Maven builds happy
***
#Check_your_buildproperties Check your build.properties
***
#Check_your_manifestmf_dependencies Check your manifest.mf dependencies
+*This article is a replacement for its precursor, https://community.jboss.org/docs/DOC-15513 How to Build JBoss Tools 3.2 with Maven 3.*+
+*Note that this article only discusses building from trunk. If you need to build from a branch, or switch between branches and/or trunk, see* https://community.jboss.org/docs/DOC-17497 How to Build JBoss Tools With Maven3 - Working With Branches+*.*
*+Looking for how to build our documentation? See+ https://community.jboss.org/docs/DOC-13341 Building JBoss Tools Documentation.*
h2. Environment Setup
h3. Prerequisistes
1. Java 1.6 SDK
2. Maven 3.0.3
3. About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools) - *requires VPN access*
4. subversion client 1.6.X (should work with lower version as well, but newer versions may not work as expected)
h3. Maven and Java
Make sure your maven 3 is available by default and Java 1.6 is used.
mvn -version
should print out something like
*Apache Maven 3.0.3* (r1075438; 2011-02-28 12:31:09-0500)
*Java version: 1.6.0_25*, vendor: Sun Microsystems Inc.
*Java home: /usr/java/jdk1.6.0_25/jre*
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.42.3-2.fc15.x86_64", arch: "amd64", family: "unix"
h3. Maven settings
Follow https://community.jboss.org/docs/DOC-15170 these instructions to add reference to JBoss Repositories into your settings.xml. You'll also probably need access to the SNAPSHOT repository. So here is what you should see in your ~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
....
<profiles>
....
<profile>
<id>jboss-default</id>
<repositories>
<!-- To resolve parent artifact -->
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<pluginRepositories>
<!-- To resolve parent artifact -->
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
<pluginRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshots Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>jboss-default</activeProfile>
...
</activeProfiles>
</settings>
h3. Maven & Java Memory Configuration
To configure the amount of memory used by Maven, you can define MVN_OPTS as follows, either in the mvn / mvn.bat script you use to run Maven, or set as global environment variables. Here's how to do so for http://forums.fedoraforum.org/showthread.php?t=262465 Fedora, https://help.ubuntu.com/community/EnvironmentVariables Ubuntu, http://forums.techarena.in/windows-xp-support/1152405.htm Windows, http://www.digitaledgesw.com/node/31 OSX.
{code}
set MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
{code}
h2. Verify or Install ?
+mvn verify+ will perform all build and test steps, but it won't install the bundles in your local repository. +mvn install+ does install in you local repository. When an eclipse-plugin is installed in your repo, it is always used as default when resolving dependency. It is not possible to roll-back a local installation of a bundle, so in most cases, +mvn verify+ is to be prefered to +mvn install+. However, if you want to build stuff sequentially through several maven invocations, and you want to resolve against just-built stuff, you'll need to use +mvn install+.
In this page, we'll encourage people to use *mvn verify* as much as possible to ensure *isolation*; but you can mvn install the same way if your use-case requires it.
h2. About Target Platform and related profiles
The target platform (TP) lists all dependencies (coming from Eclipse.or and other 3rd-party update sites) that are used by JBoss Tools. This target platform is materialized as an Eclipse p2 repository (formerly update-site) that is used during build to resolve dependencies. Target Platform is managed by JBoss Tools people, and only dependencies from this TP are allowed to be used in code.
If you need a new dependency in the TP, feel free to https://issues.jboss.org/secure/CreateIssueDetails!init.jspa?pid=10020&su... open a ticket to request it.
Here are several ways to build locally using this target platform. It's up to you to choose the one that match your needs:
h3. Using published Target Platform definition (Recommanded)
unified.target refers to the dependency as published in the Target Platfrom repository.
* Pros:* No additional thing to do than invoking Maven
* Always up-to-date
* Cons: Speed - (to evaluate)
Consume it by adding* +-Punified.target+* to you Maven invocation command-line
h3. Or, getting a local copy of the Target Platform
* Pros: Speed +++
* Cons: Step to be repeated whenever https://source.jboss.org/browse/JBossTools/trunk/build/target-platform/un... target platform changes
h4. Set up
h5. Download TP as a zip and install it by yourself
You can either download the TP as a zip and unpack it into some folder on your disk. For convenience, the easiest is to unzip into jbosstools/build/target-platform/REPO/, since that's where the Maven or Ant process will by default operate.
You can get it with a browser or a command line tool such as wget or curl at the following url: http://download.jboss.org/jbosstools/updates/target-platform_3.3.indigo.SR2/ http://download.jboss.org/jbosstools/updates/target-platform_3.3.indigo.S...<actualFilename>*+.target.zip
and then unzip it here (the default path for -Dlocal.site, which means you can call maven with +*-Plocal.site*+ and not need to pass in +*-Dlocal.site=file:///path/to/some/other/folder/*+ as well):
unzip *.target.zip -d jbosstools/build/target-platform/REPO/
*(Note that the default path used for <local.site> will change every time a new target platform is released which is a significant change over the previous (eg., SR1, SR2), so if this breaks because the default not points at an empty folder, it's time to get a new TP! Hurray for build-time notification you're using an old target platform!)*
h5. OR, use Maven+Ant to get it
In that case, you also need Ant 1.8.2 or later*.*
cd jbosstools/build/target-platform
mvn clean install -Pget.local.target
The get.local.target profile will resolve the target platform file, multiple.target, as a p2 repository on your local disk in ~/trunk/build/target-platform/REPO/. It may take a while, so you're better off from a speed point-of-view simply fetching the latest zip [5]. However, if you want to see what actually happens to create the TP (as done in Hudson) this is the approach to take.
Since the Maven profile is simply a wrapper call to Ant, you can also use Ant 1.8 or later directly:
cd jbosstools/build/target-platform
ant help # show usage instructions
h4. Use
Just add -*P local.site -Dlocal.site=file:///path/to/target/repository/*
*NOTE:* You must specify a path starting with *file:///* (three or more slashes) to avoid errors such as "+p2.core.ProvisionException URI has an authority component+".
Examples
*LINUX / MAC USERS*
cd build
mvn clean install -U -B -fae -e -*P local.site -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/*| tee build.all.log.txt
*WINDOWS USERS*
cd c:\trunk\build
mvn3 clean install -U -B -fae -e -Plocal.site *-Dlocal.site=file:///C:/trunk/build/target-platform/REPO/* > build.all.log.txt
h2. (Optional) Build parent and target platform
This step is only useful if you are actually working on the parent or the target platform and want to test it locally. Otherwise, Maven will simply retrieve parent and TP from *https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/ JBoss Nexus* to perform your build.
This is only necessary when the TP change, prior to 3.3.Beta3
svn co http://svn.jboss.org/repos/jbosstools/trunk jbosstools
cd jbosstools/build/parent
mvn clean install
...
[INFO] Reactor Summary:
[INFO]
[INFO] JBoss Tools Target Platform Definition ............ SUCCESS [0.724s]
[INFO] JBoss Tools Parent ................................ SUCCESS [0.461s]
...
*NOTE: You need not fetch the entire JBoss Tools tree from SVN (or Git (http://divby0.blogspot.com/2011/01/howto-partially-clone-svn-repo-to-git....
*Instead, you can just fetch the build/ folder and one or more component folders, then as before,*
*build the parent pom. After that, go into the component folder and run maven there (#runmavenpercomponent).*
mkdir jbosstools
cd jbosstools
svn co http://svn.jboss.org/repos/jbosstools/trunk/ http://svn.jboss.org/repos/jbosstools/trunk/build
svn co http://svn.jboss.org/repos/jbosstools/trunk/ http://svn.jboss.org/repos/jbosstools/trunk/jmx
cd jbosstools/build/parent
mvn clean install
...
[INFO] Reactor Summary:
[INFO]
[INFO] JBoss Tools Target Platform Definition ............ SUCCESS [0.724s]
[INFO] JBoss Tools Parent ................................ SUCCESS [0.461s]
...
h2. Building Individual Components Locally Via Commandline
h3. Build a component resolving to a recent aggregation build for other JBT dependencies (Recommanded)
* Pros:* You build only your component
* You only need source for your component
* Speed to resolve deps: +
* You get generally the latest build for you component
* Cons:* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change. More risk to get out of sync than with the staging site.
Tracked by https://issues.jboss.org/browse/JBIDE-11516 https://issues.jboss.org/browse/JBIDE-11516
example:
*cd jmx*
mvn verify -P unified.target *-Pjbosstools-staging-aggregate*
h3. Build a component resolving to the latest CI builds for other JBT dependencies
* Pros:* You build only your component
* You only need source for your component
* You get generally the latest build for you component
* Cons* Takes some time to resolve dependencies on other component
* Can sometimes be out of sync if no build occured recently for a component you rely on and had some important change
* Speed to resolve deps: -
This profile is the one use for CI builds on Hudson.
*cd jmx*
mvn verify -P unified.target *-Pjbosstools-nightly-staging-composite*
h3. Build a component along with all its dependencies from sources ("bootstrap" build)
This will build exactly what you have locally
* Pros:* You are sure of the version of sources that is used for your JBT dependencies
* You don't loose time in resolving your JBT deps
* Cons:* You need sources for your dependencies too
* You often build more stuff that what you really want to test
cd ~/trunk/build
mvn verify -P unified.target -*P jmx-bootstrap*
h2. Building Everything In One Build Locally Via Commandline
Assuming you have a local copy of the target platform in ${HOME}/trunk/build/target-platform/REPO/ (as explained previously:
*LINUX / MAC USERS*
cd build
mvn clean install -P local.site -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ | tee build.all.log.txt
(tee is a program that pipes console output to BOTH console and a file so you can watch the build AND keep a log.)
*WINDOWS USERS*
cd c:\trunk\build
mvn3 clean verify -P local.site -Dlocal.site=file:///C:/trunk/build/target-platform/REPO/
or
mvn3 clean verify -Plocal.site -Dlocal.site=file:///C:/trunk/build/target-platform/REPO/ > build.all.log.txt
If you downloaded the zip and unpacked is somewhere else, use -Dlocal.site=file:///.../ to point at that folder instead
h2. Building Locally In Eclipse
First, you must have installed m2eclipse into your Eclipse (or JBDS). You can install the currently supported version from this update site:
http://download.jboss.org/jbosstools/updates/indigo/ http://download.jboss.org/jbosstools/updates/indigo/
Next, start up Eclipse or JBDS and do *File > Import* to import the project(s) you already checked out from SVN above into your workspace.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-61-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Browse to where you have the project(s) checked out, and select a folder to import pom projects. In this case, I'm importing the parent pom (which refers to the target platform pom). Optionally, you can add these new projects to a working set to collect them in your Package Explorer view.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-61-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Once the project(s) are imported, you'll want to build them. You can either do *CTRL-SHIFT-X,M (Run Maven Build),* or right-click the project and select *Run As > Maven Build*. The following screenshots show how to configure a build job.
First, on the *Main* tab, set a *Name*, *Goals*, *Profile*(s), and add a *Parameter*. Or, if you prefer, put everything in the *Goals* field for simplicity:
+clean install -U -B -fae -e -Plocal.site -Dlocal.site=file://home/nboldt/tmp/JBT_REPO_Indigo/+
Be sure to check *Resolve Workspace artifacts*, and, if you have a newer version of Maven installed, point your build at that *Maven Runtime* instead of the bundled one that ships with m2eclipse.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-61-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *JRE* tab, make sure you're using a 6.0 JDK.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-61-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Refresh* tab, define which workspace resources you want to refresh when the build's done.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-61-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
On the *Common* tab, you can store the output of the build in a log file in case it's particularly long and you need to refer back to it.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-61-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Click *Run* to run the build.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-61-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-6...
Now you can repeat the above step to build any other component or plugin or feature or update site from the JBoss Tools repo. Simply import the project(s) and build them as above.
h2. Installation Testing - making sure your stuff can be installed
Each component, when built, produces a update site zip and an unpacked update site which can be used to install your freshly-built features and plugins into a running Eclipse or JBDS instance.
Simply point your Eclipse at that folder or zip, eg., jar:file:/home/rob/code/jbtools/jbosstools/trunk/runtime/site/target/runtime.site.zip! or file:///home/rob/code/jbtools/jbosstools/trunk/runtime/site/target/repository/, and browse the site. If your component requires other upstream components to install, eg., Runtime Detection depends on JBoss Common, you will also need to provide a URL from which Eclipse can resolve these missing dependencies. In order of freshness, you can use:
1. http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ http://download.jboss.org/jbosstools/updates/nightly/core/trunk/ (Nightly Trunk Site - updated every few hours or at least daily - *bleeding edge*)
2. http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/ (Composite Staging Site - updated every time a component respins - *bleedinger edge*)
3. http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ http://anonsvn.jboss.org/repos/jbosstools/trunk/build/aggregate/local-site/ (see the README.txt for how to use this site to refer to things you built locally - *bleedingest edge*)
h2. Adding a new feature or plugin to an existing component
Need to tweak a component to add a new plugin or feature? See https://community.jboss.org/docs/DOC-18373 https://community.jboss.org/wiki/AddingAPluginandorFeatureToAnExistingCom....
h2.
h2. Tips and tricks for making BOTH PDE UI and headless Maven builds happy
It's fairly common to have plugins compiling in eclipse while tycho would not work. Basically you could say that tycho is far more picky compared to Eclipse PDE.
h3.
Check your build.properties
Check build.properties in your plugin. If it has warnings in Eclipse, you'll most likely end with tycho failing to compile your sources. You'll have to make sure that you correct all warnings.
Especially check your build.properties to have entries for *source..* and *output..* -- these are needed to *http://wiki.eclipse.org/Minerva#Source generate source plugins and features*.
*
*
source.. = src/
output.. = bin/
src.includes = *
src.excludes = src
bin.includes = <your own,\
list of,\
files for inclusion,\
in the jar>
h3. Check your manifest.mf dependencies
A new issue when building against juno shows that all compilation dependencies MUST be EXPLICITLY mentioned in your manifest.mf list of dependencies. A recent example of how this can cause compilation errors is the archives module, which failed to build due to the org.eclipse.ui.views plugin, and its IPropertySheetPage interface, not being found during the build. After investigation, it was discovered that the archives.ui plugin did not explicitly declare a dependency on org.eclipse.ui.views.
Inside eclipse and during indigo builds, however, the depencency was found and there were no compilation errors. This was because a plugin archives.ui explicitly dependend on (org.eclipse.ui.ide) had an explicit dependency on org.eclipse.ui.views. The IDE was able to see that archives.ui dependended on org.eclipse.ui.ide, and org.eclipse.ui.ide depended on org.eclipse.ui.views.
Resolving nested dependencies no longer seems to be guaranteed, and so anything you have a compilation dependency on must now be explicitly declared in your manifest.mf
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-16604]
Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
10 years, 6 months
[JBoss AS 7 Development] - AS7 Management Console 2.0
by Heiko Braun
Heiko Braun [https://community.jboss.org/people/heiko.braun] modified the document:
"AS7 Management Console 2.0"
To view the document, visit: https://community.jboss.org/docs/DOC-47385
--------------------------------------------------------------
h3. Project Information
| - Roadmap (https://issues.jboss.org/browse/AS7/component/12313823)
- Issue Tracking (https://issues.jboss.org/browse/AS7)
- Source Code:
- Authoritative master: https://github.com/jbossas/console
- Most recent: https://github.com/jbossas/console/tree/develop
- Hacking the Codebase (https://community.jboss.org/docs/DOC-16607)
- Releases (https://community.jboss.org/docs/DOC-47610)
If you are looking for stable build, then you should consider the jbossas/console repository.
Current development however, takes place on the "develop" branch. Stable milestones will be merged onto "master" with every release. | Jenkins: https://hudson.jboss.org/hudson/job/AS7ManagementConsole/lastBuild/buildS... (https://hudson.jboss.org/hudson/job/AS7ManagementConsole/lastBuild/) |
h2. Extension Mechanism
In relation to http://hbraun.info/2012/09/web-console-architecture-future-directions/ http://hbraun.info/2012/09/web-console-architecture-future-directions/
* GWT Composition
Build time, lowest common denominator, based on building blocks but manual plumbing
We have an example of this mechanism implemented already: https://github.com/heiko-braun/composite-ui https://github.com/heiko-braun/composite-ui
* Plugin descriptiors
Abstract model, relies on fixed schema (DMR metadata+UI properties), fixed set of supported traits, can be consumed by many clients
* Runtime extensions
Applicable to both options above. Removes compile time dependecy.
h3. Layered Projects
Some projects already integrate/extend the AS7 console.
|| *Project Name* || *Repository* || *Status* ||
| Switchyard | https://github.com/rcernich/jbossas-console/tree/master-hbraun | Does build on a previous version. Should update to >1.5.0 |
| Teiid | https://github.com/teiid/teiid-web-console | Implements the most current version (1.5.0-SNAPSHOT) |
|
|
|
|
h2. UI design & Interaction Patterns
General UI design issues and ideas https://community.jboss.org/docs/DOC-47685 are collected here.
h3. Core UX Elements & Concepts
An overview of the current UX concepts (including widgets) can be found here:
http://heiko-braun.github.com/pages/as7/docs/ux.html http://heiko-braun.github.com/pages/as7/docs/ux.html
h2. Requirements, Ideas, Nice-to-Have
||
|| *Desc* ||
| C0100 | The UI must be able to dynamically render model elements based solely upon its predefined description (the description may (and probably often will) include UI-specific elements to give "hints" to the renderer; i.e. 0 lines of XHTML is better than 10) (note that AS8 descriptions are likely to be more robust and easier to produce than AS7) |
| C0200 | The UI must provide (or work with) a mechanism by which multi-step tasks (so-called "wizards") can be defined and subsequently rendered for specific model element types, such that these operations may be automatically associated with their corresponding model elements (even better if the task metadata were reusable by other tools e.g. CLI) |
| C0300 | Using these tools it should be possible to generate UIs on many platforms (GWT, Swing, iOS/Android, maybe JON, maybe third-party mgmt tools, ???) which all look, act, and "feel" as similar as possible |
| C0350 | RHQ/JON upstream. Acts as POC for C0300 |
| C0400 | i18n |
| C0500 | Authorisation & Authentication |
| C0600 | 508 compliance |
|
|
|
--------------------------------------------------------------
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
10 years, 6 months
[JBoss AS 7 Development] - How can I determine when the ModelController service is fully started
by Ed Roberts
Ed Roberts [https://community.jboss.org/people/ejroberts] created the discussion
"How can I determine when the ModelController service is fully started"
To view the discussion, visit: https://community.jboss.org/message/776730#776730
--------------------------------------------------------------
I have an OSGi service that provides container properties (i.e. JBoss Model) to our other OSGi bundles.
We moved to a late October build of 7.2.0.Alpha1 from 7.1.1.Final. With the move, the startup timing between the ModelController service and the OSGi deployments changed.
When my code queried the model before it was fully started, the Model Controller was returning a successful operation outcome, but the query would return an undefined value.
With the latest build from github attribute queries prior to a started state now quite rightly return an unsuccessful operation outcome, and the following error is logged
2012-11-15 15:35:39,436 ERROR [org.jboss.as.controller.management-operation](EclipseGeminiBlueprintExtenderThread-18) JBAS014613: Operation ("read-attribute") failed - address: ([("interface" => "internal")]) - failure description: "JBAS014807: Management resource '[(\"interface\" => \"internal\")]' not found"
My question is, what can I test to make sure the Model and Service are fully started before querying, in order to avoid these errors being logged ?
I tried using the controller state before, but it wasn't actually changing to indicate it had started.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/776730#776730]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
10 years, 6 months