[JBoss AS 7 Development] - My custom login module class could not be found by JBOSS???
by Serkan Yıldırım
Serkan Yıldırım [https://community.jboss.org/people/sekobey] created the discussion
"My custom login module class could not be found by JBOSS???"
To view the discussion, visit: https://community.jboss.org/message/732090#732090
--------------------------------------------------------------
Hi everybody,
I'm working on login a remote ejb client to the JBOSS 7.1.1 server for a one week, however i am not successful. I use my own security-domain which consists of remoting, LdapExtended and my custom login module. I see in the logs LdapExt login is successful, however my login module class is not found. I tried deploying my login module in a jar which in my ear file, i define a new module in modules folder and i add module tag in login module definition in standalone.xml and at last i tried changing org/jboss/as/remoting module's xml file by adding my login module jar as resource-root. However my all trials are failed. Now i don't know how JBOSS show my custom login module.
I added standalone.xml, myloginmodule.jar as attachments. jar file is added as resource root in org/jboss/as/remoting/module.xml. My client code is like this, there is no jboss-ejb-client.properties because i give parameters as hard-coded.
*My client code:*
Properties pr = new Properties();
pr.put("endpoint.name", "client-endpoint");
pr.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
pr.put("remote.connections", "default");
pr.put("remote.connection.default.port", "4447");
pr.put("remote.connection.default.host", "10.204.10.54");
pr.put("remote.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS-LOCAL-USER");
pr.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
pr.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
pr.put("remote.connection.default.username", "49351259682");
pr.put("remote.connection.default.password", "Test12345");
EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(pr);
ContextSelector < EJBClientContext > selector = new ConfigBasedEJBClientContextSelector(cc);
EJBClientContext.setSelector(selector);
Properties props = new Properties();
props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
props.put("jboss.naming.client.ejb.context", true);
try {
Context c = new InitialContext(props);
kullaniciEJB = (KullaniciEJBRemote) c.lookup("ejb:merveys-kayit-tckkys/merveys-kayit-ejb-tckkys//KullaniciEJB!tr.gov.tubitak.bilgem.uekae.deys.tckk.merveys.common.controller.ejb.kullanici.KullaniciEJBRemote");
} catch (NamingException e) {
e.printStackTrace();
}
int count = kullaniciEJB.countKartIslemList(1L, null, null);
*Error log is below:*
11:26:59,626 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] (Remoting "sekobey" task-2) Begin getAppConfigurationEntry(TckkysSecurity), size
=4
11:26:59,628 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] (Remoting "sekobey" task-2) End getAppConfigurationEntry(TckkysSecurity), authIn
fo=AppConfigurationEntry[]:
[0]
LoginModule Class: org.jboss.as.security.remoting.RemotingLoginModule
ControlFlag: LoginModuleControlFlag: optional
Options:
name=password-stacking, value=useFirstPass
[1]
LoginModule Class: org.jboss.security.auth.spi.LdapExtLoginModule
ControlFlag: LoginModuleControlFlag: required
Options:
name=baseFilter, value=(sAMAccountName={0})
name=bindDN, value=tckk\administrator
name=rolesCtxDN, value=cn=Users,dc=TCKK,dc=net
name=roleNameAttributeID, value=name
name=baseCtxDN, value=ou=TCKK,dc=TCKK,dc=net
name=password-stacking, value=useFirstPass
name=java.naming.factory.initial, value=com.sun.jndi.ldap.LdapCtxFactory
name=java.naming.security.authentication, value=simple
name=roleFilter, value=(member={1})
name=allowEmptyPasswords, value=false
name=java.naming.provider.url, value=ldap://tckk_ldap:389
name=bindCredential, value=****
name=roleAttributeIsDN, value=true
name=searchScope, value=ONELEVEL_SCOPE
name=throwValidateError, value=true
[2]
LoginModule Class: tr.gov.tubitak.bilgem.uekae.deys.tckk.merveys.kayit.controller.util.KysRolLoginModule
ControlFlag: LoginModuleControlFlag: required
Options:
name=dsJndiName, value=java:/TckkDS
name=password-stacking, value=useFirstPass
11:26:59,677 TRACE [org.jboss.as.security.remoting.RemotingLoginModule] (Remoting "sekobey" task-2) initialize
11:26:59,679 TRACE [org.jboss.as.security.remoting.RemotingLoginModule] (Remoting "sekobey" task-2) Security domain: TckkysSecurity
11:26:59,681 TRACE [org.jboss.as.security.remoting.RemotingLoginModule] (Remoting "sekobey" task-2) login
11:26:59,682 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (Remoting "sekobey" task-2) initialize
11:26:59,684 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (Remoting "sekobey" task-2) Security domain: TckkysSecurity
11:26:59,685 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (Remoting "sekobey" task-2) login
11:26:59,686 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (Remoting "sekobey" task-2) Failed to parse: null, disabling recursion: java.lang.
NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:417) [rt.jar:1.6.0_26]
at java.lang.Integer.parseInt(Integer.java:499) [rt.jar:1.6.0_26]
at org.jboss.security.auth.spi.LdapExtLoginModule.createLdapInitContext(LdapExtLoginModule.java:395) [picketbox-4.0.7.Final.jar:4.0.7.Final]
at org.jboss.security.auth.spi.LdapExtLoginModule.validatePassword(LdapExtLoginModule.java:312) [picketbox-4.0.7.Final.jar:4.0.7.Final]
at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:267) [picketbox-4.0.7.Final.jar:4.0.7.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769) [rt.jar:1.6.0_26]
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) [rt.jar:1.6.0_26]
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) [rt.jar:1.6.0_26]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_26]
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) [rt.jar:1.6.0_26]
at javax.security.auth.login.LoginContext.login(LoginContext.java:579) [rt.jar:1.6.0_26]
at org.jboss.as.domain.management.security.JaasCallbackHandler.handle(JaasCallbackHandler.java:126) [jboss-as-domain-management-7.1.1.Final.ja
r:7.1.1.Final]
at org.jboss.as.remoting.RealmSecurityProvider$RealmCallbackHandler.handle(RealmSecurityProvider.java:418) [jboss-as-remoting-7.1.1.Final.jar:
7.1.1.Final]
at org.jboss.sasl.util.AbstractSaslParticipant.tryHandleCallbacks(AbstractSaslParticipant.java:98) [jboss-sasl-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.sasl.util.AbstractSaslParticipant.handleCallbacks(AbstractSaslParticipant.java:83) [jboss-sasl-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.sasl.plain.PlainSaslServer.access$000(PlainSaslServer.java:41) [jboss-sasl-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.sasl.plain.PlainSaslServer$1.evaluateMessage(PlainSaslServer.java:95) [jboss-sasl-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.sasl.util.AbstractSaslParticipant.evaluateMessage(AbstractSaslParticipant.java:165) [jboss-sasl-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.sasl.util.AbstractSaslServer.evaluateResponse(AbstractSaslServer.java:56) [jboss-sasl-1.0.0.Final.jar:1.0.0.Final]
at org.xnio.sasl.SaslUtils.evaluateResponse(SaslUtils.java:194) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
at org.jboss.remoting3.remote.ServerConnectionOpenListener$AuthStepRunnable.run(ServerConnectionOpenListener.java:407) [jboss-remoting-3.2.3.G
A.jar:3.2.3.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
11:26:59,745 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (Remoting "sekobey" task-2) Logging into LDAP server, env={throwValidateError=true
, baseFilter=(sAMAccountName={0}), allowEmptyPasswords=false, java.naming.security.credentials=***, jboss.security.security_domain=TckkysSecurity, pas
sword-stacking=useFirstPass, java.naming.security.authentication=simple, baseCtxDN=ou=TCKK,dc=TCKK,dc=net, roleAttributeIsDN=true, rolesCtxDN=cn=Users
,dc=TCKK,dc=net, java.naming.security.principal=tckk\administrator, searchScope=ONELEVEL_SCOPE, java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxF
actory, roleFilter=(member={1}), java.naming.provider.url=ldap://tckk_ldap:389, roleNameAttributeID=name, bindDN=tckk\administrator, bindCredential=**
*}
*11:26:59,755 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (Remoting "sekobey" task-2) Logging into LDAP server, env={throwValidateError=true*
*, baseFilter=(sAMAccountName={0}), allowEmptyPasswords=false, java.naming.security.credentials=***, jboss.security.security_domain=TckkysSecurity, pas*
*sword-stacking=useFirstPass, java.naming.security.authentication=simple, baseCtxDN=ou=TCKK,dc=TCKK,dc=net, roleAttributeIsDN=true, rolesCtxDN=cn=Users*
*,dc=TCKK,dc=net, java.naming.security.principal=CN=serkan y²ld²r²m,OU=TCKK,DC=TCKK,DC=net, searchScope=ONELEVEL_SCOPE, java.naming.factory.initial=com*
*.sun.jndi.ldap.LdapCtxFactory, roleFilter=(member={1}), java.naming.provider.url=ldap://tckk_ldap:389, roleNameAttributeID=name, bindDN=tckk\administr*
*ator, bindCredential=***}*
*11:26:59,763 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (Remoting "sekobey" task-2) User '49351259682' authenticated, loginOk=true*
11:26:59,764 TRACE [org.jboss.remoting.remote.server] (Remoting "sekobey" task-2) Server sending authentication rejected (javax.security.sasl.SaslExce
*ption: Callback handler invocation failed [Caused by java.lang.NoClassDefFoundError: Could not initialize class tr.gov.tubitak.bilgem.uekae.deys.tckk.*
*merveys.kayit.controller.util.KysRolLoginModule])*
11:26:59,767 TRACE [org.xnio.channels.framed] (Remoting "sekobey" task-2) Accepting java.nio.HeapByteBuffer[pos=0 lim=1 cap=8192] into java.nio.HeapBy
teBuffer[pos=0 lim=8196 cap=8196]
11:26:59,769 TRACE [org.xnio.channels.framed] (Remoting "sekobey" task-2) Accepted a message into java.nio.HeapByteBuffer[pos=5 lim=8196 cap=8196]
11:26:59,770 TRACE [org.xnio.channels.framed] (Remoting "sekobey" task-2) Fully flushed org.xnio.channels.FramedMessageChannel around TCP socket chann
el (NIO) <1de0ed6>
11:26:59,771 TRACE [org.xnio.nio.selector] (Remoting "sekobey" read-1) Selected on sun.nio.ch.WindowsSelectorImpl@18abaa4
11:26:59,771 TRACE [org.jboss.remoting.remote.connection] (Remoting "sekobey" task-2) Sent message java.nio.HeapByteBuffer[pos=1 lim=1 cap=8192] (dire
ct)
11:26:59,772 TRACE [org.xnio.nio.selector] (Remoting "sekobey" read-1) Selected key sun.nio.ch.SelectionKeyImpl@1a01913 for java.nio.channels.SocketCh
annel[connected local=SEKOBEY.ug.net/10.204.10.54:4447 remote=/10.204.10.54:54551]
11:26:59,773 TRACE [org.xnio.channels.framed] (Remoting "sekobey" task-2) Fully flushed org.xnio.channels.FramedMessageChannel around TCP socket chann
el (NIO) <1de0ed6>
11:26:59,774 TRACE [org.xnio.listener] (Remoting "sekobey" read-1) Invoking listener Read listener for org.xnio.channels.FramedMessageChannel around T
CP socket channel (NIO) <1de0ed6> on channel TCP socket channel (NIO) <1de0ed6>
11:26:59,774 TRACE [org.jboss.remoting.remote.connection] (Remoting "sekobey" task-2) Flushed channel (direct)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/732090#732090]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 8 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven 3
by Mickael Istria
Mickael Istria [https://community.jboss.org/people/mickael_istria] 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
**
#About_Target_Platform_and_related_profiles About Target Platform and related profiles
***
#Getting_a_local_copy_of_the_Target_Platform_Recommanded Getting a local copy of the Target Platform (Recommanded)
****
#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
***
#Or_resolving_remotely_with_the_Unified_Target_Platform Or resolving remotely with the Unified Target Platform
**
#Optional_Build_parent_and_target_platform (Optional) Build parent and target platform
**
#Building_Everything_In_One_Build_Locally_Via_Commandline Building Everything In One Build Locally Via Commandline
**
#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_Locally_In_Eclipse Building Locally In Eclipse
**
#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
***
#Check_your_buildproperties_390509 Check your build.properties
+*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+.
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
*pache 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>
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. Getting a local copy of the Target Platform (Recommanded)
* 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 [5] 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 do that with any browser or on a command line with curl or similar:
curl -C - -O http://download.jboss.org/jbosstools/updates/target-platform_3.3.indigo.SR2/<actualFilename>.target.zip
...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 606M 100 606M 0 0 164k 0 1:02:54 1:02:54 --:--:-- 172k
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):
mkdir -p ~/.m2/jbosstools-target-platform_3.3.indigo.SR2/
unzip *.target.zip -d ~/.m2/jbosstools-target-platform_3.3.indigo.SR2/
*(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
#
h3. Or resolving remotely with the Unified Target Platform
unified.target refers to the dependency as published in the Target Platfrom repository.
* Pros: No additional thing to do than invoking Maven
* Cons: Speed ---
Consume it by adding* +-Punified.target+* to you Maven invocation command-line
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.
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 install -P local.site -Dlocal.site=file:///C:/trunk/build/target-platform/REPO/
or
mvn3 clean install -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 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
*cd jmx*
mvn clean install -P local.site -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ *-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 clean install -P local.site -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ *-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 clean install -P local.site,*jmx-bootstrap* -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ | tee build.jmx.log.txt
#
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-40-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-4...
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-40-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-4...
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-40-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-4...
On the *JRE* tab, make sure you're using a 6.0 JDK.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-40-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-4...
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-40-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-4...
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-40-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-4...
Click *Run* to run the build.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-40-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-4...
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. 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..*
*
*
source.. = src/
output.. = bin/
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.
h3. Check your build.properties
--------------------------------------------------------------
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...]
12 years, 8 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven 3
by Mickael Istria
Mickael Istria [https://community.jboss.org/people/mickael_istria] 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
**
#About_Target_Platform_and_related_profiles About Target Platform and related profiles
***
#Getting_a_local_copy_of_the_Target_Platform_Recommanded Getting a local copy of the Target Platform (Recommanded)
****
#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
***
#Or_resolving_remotely_with_the_Unified_Target_Platform Or resolving remotely with the Unified Target Platform
**
#Optional_Build_parent_and_target_platform (Optional) Build parent and target platform
**
#Building_Everything_In_One_Build_Locally_Via_Commandline Building Everything In One Build Locally Via Commandline
**
#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_Locally_In_Eclipse Building Locally In Eclipse
**
#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
***
#Check_your_buildproperties_557327 Check your build.properties
+*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+.
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
*pache 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
{code:xml} ... jboss-public-repository-group JBoss Public Repository Group http://repository.jboss.org/nexus/content/groups/public/ http://repository.jboss.org/nexus/content/groups/public/ ... jboss-snapshots-repository JBoss Snapshots Repository https://repository.jboss.org/nexus/content/repositories/snapshots/ https://repository.jboss.org/nexus/content/repositories/snapshots/ ... jboss-public-repository-group JBoss Public Repository Group http://repository.jboss.org/nexus/content/groups/public/ http://repository.jboss.org/nexus/content/groups/public/ ... jboss-snapshots-repository JBoss Snapshots Repository https://repository.jboss.org/nexus/content/repositories/snapshots/ https://repository.jboss.org/nexus/content/repositories/snapshots/ ... ... {code}
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. Getting a local copy of the Target Platform (Recommanded)
* 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 [5] 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 do that with any browser or on a command line with curl or similar:
curl -C - -O http://download.jboss.org/jbosstools/updates/target-platform_3.3.indigo.SR2/<actualFilename>.target.zip
...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 606M 100 606M 0 0 164k 0 1:02:54 1:02:54 --:--:-- 172k
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):
mkdir -p ~/.m2/jbosstools-target-platform_3.3.indigo.SR2/
unzip *.target.zip -d ~/.m2/jbosstools-target-platform_3.3.indigo.SR2/
*(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
#
h3. Or resolving remotely with the Unified Target Platform
unified.target refers to the dependency as published in the Target Platfrom repository.
* Pros: No additional thing to do than invoking Maven
* Cons: Speed ---
Consume it by adding* +-Punified.target+* to you Maven invocation command-line
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.
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 install -P local.site -Dlocal.site=file:///C:/trunk/build/target-platform/REPO/
or
mvn3 clean install -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 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
*cd jmx*
mvn clean install -P local.site -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ *-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 clean install -P local.site -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ *-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 clean install -P local.site,*jmx-bootstrap* -Dlocal.site=file:///${HOME}/trunk/build/target-platform/REPO/ | tee build.jmx.log.txt
#
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-38-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-3...
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-38-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-3...
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-38-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-3...
On the *JRE* tab, make sure you're using a 6.0 JDK.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-38-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-3...
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-38-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-3...
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-38-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-3...
Click *Run* to run the build.
https://community.jboss.org/servlet/JiveServlet/showImage/102-16604-38-13... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-16604-3...
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. 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..*
*
*
source.. = src/
output.. = bin/
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.
h3. Check your build.properties
--------------------------------------------------------------
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...]
12 years, 8 months