How to build / run metasfresh from source code

english

#1

How to build / run metasfresh from source code.

We gone through the link http://docs.metasfresh.org/developers_collection/en/getting_started_mvn_cmdline_en.html but unable to make progress.

/metasfresh/metasfresh-webui-api-master$ mvn tomcat:run
[INFO] Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/de/metas/de.metas.parent.general/[1,10.0.0]/de.metas.parent.general-[1,10.0.0].pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project de.metas.ui.web:metasfresh-webui-api:10.0.0 (/home/metasfresh/metasfresh-webui-api-master/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Could not transfer artifact de.metas:de.metas.parent.general:pom:[1,10.0.0] from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 69: http://repo.maven.apache.org/maven2/de/metas/de.metas.parent.general/[1,10.0.0]/de.metas.parent.general-[1,10.0.0].pom and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Can you please provide detail steps to build each project.

metasfresh/metasfresh-dist-master
metasfresh/metasfresh-master
metasfresh/metasfresh-parent-master
metasfresh/metasfresh-procurement-webui-master
metasfresh/metasfresh-webui-api-master
metasfresh/metasfresh-webui-frontend-master

How run metasfresh source code locally on Ubuntu 14.04?
Please provide detailed steps to test source code locally with test data.

Thanks,
Amol.


#2

Hi @amolgadre,
to solve the reported problem, please take a look here .


#3

Thank you so much for quick reply. We will try and get back to you. :slight_smile:


#4

After placing settings.xml file under maven.m2 folder, MetasFresh project compile successfully using mvn install command. I did execute mvn install command under metasfresh-parent-master repository.

After that I tried below steps-

When this is done, please cd to your working copy of the metasfresh repo, and then cd to de.metas.parent.

There, please do
mvn --non-recursive install

But we didn’t find de.metas.parent package under metasfresh-master repository.
Same problem faced for below step also

ESB bundles
metasfresh comes with anumber of servicemix OSGI bundles for advanced usage scenarios.

To build those, go back to your metasfresh working copy, cd into de.metas.esb and run mvn install.

We didn’t find de.metas.esb under metasfresh-master repository.

After all the above steps, we have executed below step -

metasfresh-dist
The maven projects that build the actual distributable is in metasfresh-dist. To create the distributable, enter the metasfresh-dist folder and run mvn install

During mvn install execution we faced below error.

[ERROR] Failed to execute goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.16:launch4j (l4j-clui) on project metasfresh-dist-swingui: Failed to build the executable; please verify your configuration. net.sf.launch4j.ExecException: java.io.IOException: Cannot run program “/home/.m2/repository/net/sf/launch4j/launch4j/3.9/launch4j-3.9-workdir-linux/bin/windres”: error=2, No such file or directory -> [Help 1]

Can you please help us to resolve the above 3 errors/issues? Or can you please let us know if we have missed something?

Just for your information, we have below 6 repositories under Metasfresh. Please let me us if you see anything wrong in this.

metasfresh-dist-master
metasfresh-master
metasfresh-parent-master
metasfresh-procurement-webui-master
metasfresh-webui-api-master
metasfresh-webui-frontend-master


#5

Hello Tobias,

Good Day,

Did you get chance to look into my last update of MetasFresh local installation problems? :slight_smile:

I tried further steps today and prepared metasfresh database locally. After that tried to below same step again.

to install the “main” parent pom in your local maven artifact repository.

When this is done, please cd to your working copy of the metasfresh repo, and then cd to de.metas.parent.

There, please do

mvn --non-recursive install

But i didn’t find de.metas.parent. package under metasfresh-master main repository. When searched same package and found that it is under maven .m2 folder.
./.m2/repository/de/metas/de.metas.parent

But I don’t think so it is correct location.

Could you please help us to resolve these local installation issues?

Regards,
Amol


#6

Hi @amolgadre,
sorry for replying so late.
some time ago, we moved some of the legacy code out of the metasfresh repo (issue #3451).

Now i noticed that i updated the documentation, but did not integrate that change :frowning:
I’m doing this right now.
This should solve the issue regarding “de.metas.parent” and “ESB bundles”.

Regarding the issue with metasfresh-dist: that problem seems to be related to the legacy swing client’s exe, which maven tries to build as well.

The bad news is that this part often calls build problems here and there. In your particular case, you might need to install libc6:i386 (i.e. the 32-bit one).

The good news is that we planned to remove the exe for some time now (even our windows users rather ose the .batfile instead, for different reasons), and I’m doing this just now: https://github.com/metasfresh/metasfresh-dist/issues/35 :slight_smile:

Best regards
Tobias


#7

Thank you Tobias for detailed update.

Regarding your comment below

I am currently using 64-bit Ubuntu 14.04 version

We will try to test with your latest code fix and let you know how it goes.

Regards,
Amol.


#8

Hello @metas-ts

We took latest code base from gihub using git clone command and followed Build metasfresh from command line document steps. We compiled metasfresh-parent successfully without any issue. but while executing 2nd step

to install the “main” parent pom in your local maven artifact repository.

When this is done, please cd to your working copy of the metasfresh repo.

There, please do

mvn install

under main repository metasfresh using mvn install command but faced below error.

localhost:~/Metasfresh/metasfresh$ mvn install
    [INFO] Scanning for projects...
    Downloading: https://repo.metasfresh.com/content/groups/mvn-master/de/metas/de.metas.parent.general/[1,10.0.0]/de.metas.parent.general-[1,10.0.0].pom
    Downloading: http://repo.maven.apache.org/maven2/de/metas/de.metas.parent.general/[1,10.0.0]/de.metas.parent.general-[1,10.0.0].pom
    [ERROR] The build could not read 1 project -> [Help 1]
    [ERROR]   
    [ERROR]   The project de.metas:de.metas.parent:10.0.0 (/home/Metasfresh/metasfresh/pom.xml) has 1 error
    [ERROR]     Non-resolvable parent POM: Could not transfer artifact de.metas:de.metas.parent.general:pom:[1,10.0.0] from/to metasfresh-repo (https://repo.metasfresh.com/content/groups/mvn-master/): Illegal character in path at index 87: https://repo.metasfresh.com/content/groups/mvn-master/de/metas/de.metas.parent.general/[1,10.0.0]/de.metas.parent.general-[1,10.0.0].pom and 'parent.relativePath' points at wrong local POM @ line 5, column 10 -> [Help 2]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
    [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Could you please help us to resolve this issue. We also facing lots of maven dependency issue in eclipse.

Thanks,
Amol.


#9

Hi @amolgadre ,

Can you verify that it is in you local maven repo (i.e. depending on you setup, it problably should be in ~/Metasfresh/metasfresh/.m2/repository/de/metas/de.metas.parent.general/10.0.0).

I’m not sure what to make out of maven trying to literally download the version [1,10.0.0] instead of resolving it to the latest available verion (like 5.49.something).

These questions just go into the blue, but I hope they are helpful:

  • do you have a recent maven version?
  • can you please try running mvnw instead of mvn?
  • can you please try editing metasfresh/pom.xml's <parent> declaration and change the replacing the version [1,10.0.0] to 10.0.0?

i hope I’ll be able to do some research of my own later today and will report back if I found anything.

Best regards and thanks for you interest and efforts
Tobias


#10

Hi @amolgadre,
i wasn’t able to reproduce the problem.
Did you have success building the source code?

Best regards
Tobias


#11

I have successfully build metasfresh after putting it to metasfresh-parent project and setting maven settings.xml as described here http://docs.metasfresh.org/developers_collection/en/getting_started_maven_settings.html . Unfortunetly do not know what next. There are some maven artifacts build but main project as I suppose de.metas.adempiere.adempiere does not contain any artifact


#12

Actually, I wasn’t able to build until I added the mvn-public repository to the settings.xml file as outlined below. It might be a good idea to update the online documentation accordingly:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Licensed under http://www.apache.org/licenses/LICENSE-2.0 -->
<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">
	<!-- localRepository The path to the local repository maven will use to 
		store artifacts. Default: ~/.m2/repository If you have more than one local 
		(eclipse-)workspace, it might make sense to have one local repo per-workspace, 
		to avoid inconsistencies. <localRepository>${user.home}\.m2\mvn-eclipse-ws-1</localRepository> -->
	<profiles>
		<profile>
			<id>env-dev</id>
			<properties>
				<!-- The maven repo does not contain any metasfresh artifact with this 
					version, so m2e will just download various maven-metadata.xml files, but 
					not the binary artifacts. -->
				<metasfresh.version>10.0.0</metasfresh.version>
			</properties>

			<repositories>
				<repository>
					<id>metasfresh-repo</id>
					<name>metasfresh repository</name>
					<url>https://repo.metasfresh.com/content/groups/mvn-public/</url>
					<layout>default</layout>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</repository>
				<!-- 3rd-party libs which are not in the public central maven repository -->
				<repository>
					<id>metasfresh-3rdparty</id>
					<releases>
						<enabled>true</enabled>
						<updatePolicy>daily</updatePolicy>
						<checksumPolicy>warn</checksumPolicy>
					</releases>
					<url>https://repo.metasfresh.com/content/groups/mvn-3rdparty-all/</url>
				</repository>
			</repositories>
		</profile>

	</profiles>

	<activeProfiles>
		<activeProfile>env-dev</activeProfile>
	</activeProfiles>
</settings>