Topic: Steps to build Ametys from Git Repository

Hi,

I downloaded all the code from the master GIT repository, but when I try to build the Runtime, it fails with dependency on the common/tools which is not there.

Are there any documents available to do the compile and build of the ametys from the source code provided in the GIT repository or is that a Work in progress and we need to use the SVN memthodology only for the version 4.0.x also

Re: Steps to build Ametys from Git Repository

Hi,

before I enter into long explanations, I will first ask you : why do you want to rebuild Ametys on your own?

Ametys is different (better smile) thanother products: you never have to change it in order to add your own features... all is based on plugins and extensions. Thanks to this, upgrading from a version to another version is quite simple.

So, about 99.9% of people who ask how to build Ametys, does not need it smile
The staying 0.1% want to do it for the "sport"...

Raphael Franchet
Expert Ametys

Re: Steps to build Ametys from Git Repository

HI raphael,

thanks for the candid answer. i wanted to build it for understanding the build methodology/process. otherwise, you are right that the core functionality is very much extendable using the plugins. at the same time, if I want to build my own plugin and want to make it as a JAR file, is there a build file and steps available?

Re: Steps to build Ametys from Git Repository

Ok.

You have to know that our dependency system is ivy.

Have an ametys root directory, such as : D:\Ametys
Clone this git (https://code.ametys.org/scm/tools/tools.git) at D:\Ametys\tools\master
Then you can launch "dev/download-sources/download.xml" that will download all Ametys (just cancel the login dialog to be anonymous)
Then you can launch any build.xml at the root of each project to build it in your ivy (default location is tools/masters/dev/ivyrep)

If you use Eclipse, there are a few more recommandations to do BEFORE, so please let me know.

Raphael Franchet
Expert Ametys

Re: Steps to build Ametys from Git Repository

thanks Raphael. will try out the same and get back in case of issues

Re: Steps to build Ametys from Git Repository

Hi raphael,

there is no download.xml but download.ant. so, i tried to run the ant command as follows:

ant -f download.ant

it went to download lot of libraries but gets stuck up sometime down the line. iam using apache ant 1.9.8.

There is no ivy.properties, under the tools/master folder, but there was a file, ivy.properties.sample. if I rename that to ivy.properties, then the build fails with a SAX exception.

the ivy.properties.sample contained just one line,  ivy.settings=

once I commented that line, the build was again getting stuck up after downloading many libraries.

this is the error in the command line.

parsing buildfile jar:file:/C:/Ametys/tools/master/dev/ivyrep/cache/org.ametys.tools/tools/2.x/jars/ametys-tools-2.9.0.20180518-2230-b491-SNAPSHOT.jar!/org/ametys/tools/antlib-build.xml with URI = jar:file:/C:/Ametys/tools/master/dev/ivyrep/cache/org.ametys.tools/tools/2.x/jars/ametys-tools-2.9.0.20180518-2230-b491-SNAPSHOT.jar!/org/ametys/tools/antlib-build.xml from a zip file
[antlib:org.ametys.tools] Could not load definitions from resource org/ametys/tools/antlib.xml. It could not be found.

Re: Steps to build Ametys from Git Repository

hi raphael,

the issue was with the ametys certificate not available in the JDK. i used a keytool to import the ametys SSL certificate and now the build is running properly.

Re: Steps to build Ametys from Git Repository

The download was successful and then i proceeded to do the build of the kernel/01_Runtime. it failed with the ojdbc7 driver download. none of the dependency path URLs that the build process tries to locate the JAR file contains the JAR file.

I have downloaded the file and placed it manually in the ivyrep directory to make this build successful. will document the steps in the next post

Re: Steps to build Ametys from Git Repository

Hi ,

The runtime module build failed because of the unresolved dependency for the ojdbc7.jar. so, I added the ivy.xml file under the folder, '\tools\master\dev\ivyrep\external\com\oracle\ojdbc7\12.1.0.2'  with the following contents

<!-- https://mvnrepository.com/artifact/com. … aui/ojdbc7 -->
<ivy-module version="1.0">
<info organisation="com.oracle" module="ojdbc7" branch="${project.branch}" revision='12.1.0.2'>
        <license url="http://www.apache.org/licenses/LICENSE-2.0" name="ASL2"/>
        <description homepage="http://www.ametys.org/"/>
    </info>
    <configurations>
        <conf name="simple"/>
        <conf name="classic" extends="simple"/>
        <conf name="default" extends="classic"/> 
    </configurations>
   <!-- <publications>
        <artifact name="ametys-tools" type="jar" ext="jar"/>
        <artifact name="ametys-tools" type="source" ext="jar"/>
    </publications> -->
<dependencies>
<dependency org="com.github.noraui" name="ojdbc7" rev="12.1.0.2"/>
</dependencies>
</ivy-module>


The dependency org provided is a github location where the ojdbc7.jar is currently available. but, even after providing this, it was failing and I had to download the ojdbc7.jar from the oracle site separately and rename it as ojdbc7-12.1.0.2.jar and place it in the location, "tools\master\dev\ivyrep\external\com\oracle\ojdbc7\4.1.x\12.1.0.2\jars"

Then the runtime build was successful.

is there any build task that I can trigger which will build all the kernel modules as well as the plugins?

Re: Steps to build Ametys from Git Repository

Indeed, the ojdbc cannot be exposed due to its licence.
There are many way for you to fix this, but the simpliest is to remove the dependency and to do not try to execute the Oracle tests.

No there is no task to build all modules in a row.
Here is a script I have to build the kernel modules in a row

File to put at the root of the "01 - Runtime" :

<project name="All" default="all" xmlns:ametys="antlib:org.ametys.tools"
                                                     xmlns:clover="antlib:com.atlassian.clover"
                                                     xmlns:ivy="antlib:org.apache.ivy.ant">

    <basename property="branch" file="${basedir}"/>

    <target name="all">
        <ant dir="."/>
        <ant dir="../../02_JCR/${branch}"/>
        <ant dir="../../03_Repository/${branch}"/>
        <ant dir="../../04_Workflow/${branch}"/>
        <ant dir="../../05_Explorer/${branch}"/>
        <ant dir="../../07_CMS/${branch}"/>
        <ant dir="../../08_Web/${branch}"/>
    </target>

</project>
Raphael Franchet
Expert Ametys

Re: Steps to build Ametys from Git Repository

thanks raphael. i was doing a similar thing outside all the modules to trigger this. in between, iam facing an issue when i start the pre-built application downloaded from the site for version, 4.1.1

first time I start the CMS application, it is throwing this error and starts in safe mode.

2018-05-22 17:17:07,331 ERROR [org.ametys.plugins.core.impl.user.directory.JdbcUserDirectory] (ajp-nio-8209-exec-4;/cms/_admin/index.html) Unable to lookup ObservationManager component. Is safe mode ? It can not be retrieve in safe mode
org.apache.avalon.framework.service.ServiceException: Could not find component (key [org.ametys.core.observation.ObservationManager]) (Key='org.ametys.core.observation.ObservationManager')

but no issues in the front-end and the CMS configuration screen is coming up normally. is that a known issue that can be ignored?

Re: Steps to build Ametys from Git Repository

If you are in SafeMode this is not an issue.
I will turn this into a Info in safemode (https://issues.ametys.org/browse/RUNTIME-2833)

Raphael Franchet
Expert Ametys

Re: Steps to build Ametys from Git Repository

Hi raphael,

But I did not select any safe mode. so how the application automatically went into safe mode? or when the first time the application is going to be initialized, will it always go into safe mode?

Re: Steps to build Ametys from Git Repository

Indeed, when configuration is not set, application is in safe mode

Raphael Franchet
Expert Ametys

Re: Steps to build Ametys from Git Repository

Hi Raphael,

I was able to successfully build the master branch and the zip file containing the solr,cms & site folders have been created. I moved the cms and the site folders to a tomcat's webapps folder and also started solr using the command from the solr folder.

I was able to login to cms/_admin and create sites, but when I try to index the site, i get an error,


(AmetysRuntimeScheduler_Worker-3;/cms/_admin/plugins/admin/config/set) Unable to rebuild live workspace
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr: Unsupported operation: createConfigset

Iam not able to find a solution for this. is this a valid error?