Foren

Error while Maven Install

João Vieira, geändert vor 6 Jahren.

Error while Maven Install

New Member Beiträge: 13 Beitrittsdatum: 03.07.17 Neueste Beiträge
Hey,

i'm using liferay 7.0 and i have a few errors while maven install. And i allways got an error sign over bnd.bnd file , and when i try to do maven install, i got this on console :

BUILD FAILURE

[WARNING] C:\projects\intranet\intranetREP\LR7.0\portlets\Timesheet\bnd.bnd [0:0]: No sub JAR or directory lib/gson.jar
[WARNING] C:\projects\intranet\intranetREP\LR7.0\portlets\Timesheet\bnd.bnd [0:0]: No sub JAR or directory lib/joda-time.jar
[WARNING] C:\projects\intranet\intranetREP\LR7.0\portlets\Timesheet\bnd.bnd [0:0]: No sub JAR or directory lib/joda-convert.jar
[ERROR] C:\projects\intranet\intranetREP\LR7.0\portlets\Timesheet\bnd.bnd [0:0]: Input file does not exist: lib/gson-2.8.0.jar
[ERROR] C:\projects\intranet\intranetREP\LR7.0\portlets\Timesheet\bnd.bnd [0:0]: Input file does not exist: lib/joda-time-2.9.7.jar
[ERROR] C:\projects\intranet\intranetREP\LR7.0\portlets\Timesheet\bnd.bnd [0:0]: Input file does not exist: lib/joda-convert-1.8.1.jar

i have these JAR's at maven dependencies, and i also downloaded from maven.org but i don't know where to place them. Someone can help me with this?

thanks
thumbnail
David H Nebinger, geändert vor 6 Jahren.

RE: Error while Maven Install

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
João Vieira, geändert vor 6 Jahren.

RE: Error while Maven Install

New Member Beiträge: 13 Beitrittsdatum: 03.07.17 Neueste Beiträge
David H Nebinger:
Check my blog: http://web.liferay.com/web/user.26526/blog/-/blogs/osgi-module-dependencies
Come meet me at Devcon 2017 or 2017 LSNA!


hey David,

i already got this as in your blog, at my bnd.bnd file :

Bundle-ClassPath:\
.,\
lib/gson.jar, \
lib/joda-time.jar, \
lib/joda-convert.jar
-includeresource: \
lib/gson.jar=lib/gson-2.8.0.jar, \
lib/joda-time.jar=lib/joda-time-2.9.7.jar, \
lib/joda-convert.jar=lib/joda-convert-1.8.1.jar

and i also putted the references in build.gradle and i made the first option that you show in your blog but i still got errors...
thumbnail
David H Nebinger, geändert vor 6 Jahren.

RE: Error while Maven Install

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Okay, so with gradle when you declare a dependency in standard syntax, it will end up floating around as jarname-version.jar and so bnd has no problem pulling it in when running bnd.

Under maven, though, I think your challenge is going to be finding out what the local name is and ensuring it is what matches in the includeresource directive.

Ultimately the challenge is to get a jar that has a lib folder and then all of the dependency jars inside of that folder, then the bnd.bnd file is used to map the actual names to the logical names that are then included in the Bundle-ClassPath directive.

It may end up being easier to manually create and populate that lib folder inside of the module yourself rather than relying on maven and magic to do it for you.









Come meet me at Devcon 2017 or 2017 LSNA!
João Vieira, geändert vor 6 Jahren.

RE: Error while Maven Install

New Member Beiträge: 13 Beitrittsdatum: 03.07.17 Neueste Beiträge
David H Nebinger:
Okay, so with gradle when you declare a dependency in standard syntax, it will end up floating around as jarname-version.jar and so bnd has no problem pulling it in when running bnd.

Under maven, though, I think your challenge is going to be finding out what the local name is and ensuring it is what matches in the includeresource directive.

Ultimately the challenge is to get a jar that has a lib folder and then all of the dependency jars inside of that folder, then the bnd.bnd file is used to map the actual names to the logical names that are then included in the Bundle-ClassPath directive.

It may end up being easier to manually create and populate that lib folder inside of the module yourself rather than relying on maven and magic to do it for you.


i've already populated that lib folder with jar's dependencies.... can you confirm me if is this directory? C:\projects\intranet_v.7\liferay-ce-portal-7.0-ga4\tomcat-8.0.32\lib ????

sorry but i'm new in liferay world








Come meet me at Devcon 2017 or 2017 LSNA!
João Vieira, geändert vor 6 Jahren.

RE: Error while Maven Install

New Member Beiträge: 13 Beitrittsdatum: 03.07.17 Neueste Beiträge
i found the solution! i just had to add a folder called 'lib' into my project, and then i added those jar files.

it's done! thanks for your help David
thumbnail
Milen Dyankov, geändert vor 6 Jahren.

RE: Error while Maven Install

Expert Beiträge: 310 Beitrittsdatum: 30.10.12 Neueste Beiträge
João Vieira:
i found the solution! i just had to add a folder called 'lib' into my project, and then i added those jar files.


That is because you told bnd the files to include are in the lib folder:

lib/gson.jar=lib/gson-2.8.0.jar