Discussion:
adding plugins
(too old to reply)
Luiz Eduardo
2011-09-09 09:23:13 UTC
Permalink
hi all
(thanks to christian) now i got a tycho based project up and running
next step: i need to add eclipselink to my project. how do i do this
with tycho?
on my 'plugin' project, (as i said before, i have 3 projects: plugin,
feature and product) i added this

<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core </artifactId>
<version>2.3.0</version>
<scope>compile</scope>
</dependency>
</dependencies>

but my maven plugin on eclipse says

09/09/11 13h50min31s AFT: Missing artifact
org.eclipse.persistence:org.eclipse.persistence.core:jar:2.3.0:compile
09/09/11 13h50min31s AFT: [WARN] The POM for
org.eclipse.persistence:org.eclipse.persistence.core:jar:2.3.0 is
missing, no dependency information available
09/09/11 13h50min31s AFT: [WARN] The POM for
org.eclipse.persistence:org.eclipse.persistence.core:jar:2.3.0 is
missing, no dependency information available
09/09/11 13h50min31s AFT: Maven Builder: AUTO_BUILD

i'm using a nexus repository on my server.
is this the right path? or should i download eclipselink jars and drop
it on my eclipse folder?

what am i missing?
thanks a lot
Christian Soltenborn
2011-09-11 08:38:44 UTC
Permalink
Hi again,

well, if you generate your poms using the generate-poms goal, there is
no need for anything like this. Just make sure that the according
plug-in in your workspace has all necessary dependencies (e.g., the
eclipselink stuff), and that your workspace compiles without errors when
the target platform you use within your tycho build is activated. Tycho
will take care of the rest.

The idea is that all information about necessary dependencies is already
contained in the Eclipse metadata (e.g., the plug-ins' manifests) -
tycho "translates" them for maven, so no need to duplicate that
information within the poms.

Hope this helps,
Christian

P.S. I'm quite new to tycho myself, so please take all I say with a
grain of salt. However, I'm pretty sure that the real tycho experts
would jump in if I'm talking bs :-)


Am 09.09.2011 11:23, schrieb Luiz Eduardo:
> hi all
> (thanks to christian) now i got a tycho based project up and running
> next step: i need to add eclipselink to my project. how do i do this
> with tycho?
> on my 'plugin' project, (as i said before, i have 3 projects: plugin,
> feature and product) i added this
>
> <dependencies>
> <dependency>
> <groupId>org.eclipse.persistence</groupId>
> <artifactId>org.eclipse.persistence.core </artifactId>
> <version>2.3.0</version>
> <scope>compile</scope>
> </dependency>
> </dependencies>
>
> but my maven plugin on eclipse says
>
> 09/09/11 13h50min31s AFT: Missing artifact
> org.eclipse.persistence:org.eclipse.persistence.core:jar:2.3.0:compile
> 09/09/11 13h50min31s AFT: [WARN] The POM for
> org.eclipse.persistence:org.eclipse.persistence.core:jar:2.3.0 is
> missing, no dependency information available
> 09/09/11 13h50min31s AFT: [WARN] The POM for
> org.eclipse.persistence:org.eclipse.persistence.core:jar:2.3.0 is
> missing, no dependency information available
> 09/09/11 13h50min31s AFT: Maven Builder: AUTO_BUILD
>
> i'm using a nexus repository on my server.
> is this the right path? or should i download eclipselink jars and drop
> it on my eclipse folder?
>
> what am i missing?
> thanks a lot
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
>


--
W.C. Fields: "Horse sense is the thing a horse has which keeps it from
betting on people."
Luiz E. (GMail)
2011-09-11 16:46:38 UTC
Permalink
hey christian.
thanks again for clarify my path :P

so, i'll keep adding my plug-ins via manifest file, and tycho will take
care of the rest? nice...

another question...about the plug-ins, like, eclipselink. how do you
manage these plug-ins?
i used to drop them inside eclipse/plugins folder and add then via
manifest, but i think this is not right, because i work with a team, and
make them copy my plugins and drop in they plugin folder is not cool.
should i make a folder inside project and add this folder to build path?
VERY THANKS again :)
Christian Soltenborn
2011-09-11 16:53:31 UTC
Permalink
Hi,

I think this is exactly what target platforms are made for. See e.g.
this article:

http://kaloyanraev.blogspot.com/2011/09/sharing-pde-target-platforms-and-launch.html

Cheers,
Christian


Am 11.09.2011 18:46, schrieb Luiz E. (GMail):
> hey christian.
> thanks again for clarify my path :P
>
> so, i'll keep adding my plug-ins via manifest file, and tycho will take
> care of the rest? nice...
>
> another question...about the plug-ins, like, eclipselink. how do you
> manage these plug-ins?
> i used to drop them inside eclipse/plugins folder and add then via
> manifest, but i think this is not right, because i work with a team, and
> make them copy my plugins and drop in they plugin folder is not cool.
> should i make a folder inside project and add this folder to build path?
> VERY THANKS again :)
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
>


--
Ray Bradbury: "You have to know how to accept rejection and reject
acceptance."
Luiz E. (GMail)
2011-09-11 20:42:21 UTC
Permalink
On 09/11/2011 01:53 PM, Christian Soltenborn wrote:
> Hi,
>
> I think this is exactly what target platforms are made for. See e.g.
> this article:
>
> http://kaloyanraev.blogspot.com/2011/09/sharing-pde-target-platforms-and-launch.html
>
> Cheers,
> Christian
>
>
> Am 11.09.2011 18:46, schrieb Luiz E. (GMail):
>> hey christian.
>> thanks again for clarify my path :P
>>
>> so, i'll keep adding my plug-ins via manifest file, and tycho will take
>> care of the rest? nice...
>>
>> another question...about the plug-ins, like, eclipselink. how do you
>> manage these plug-ins?
>> i used to drop them inside eclipse/plugins folder and add then via
>> manifest, but i think this is not right, because i work with a team, and
>> make them copy my plugins and drop in they plugin folder is not cool.
>> should i make a folder inside project and add this folder to build path?
>> VERY THANKS again :)
>> _______________________________________________
>> tycho-user mailing list
>> tycho-***@eclipse.org
>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>>
>
THIS!
exactly what i need!
i've added a folder to my target platform like this:
'${workspace_loc}/project_name/lib' and is this folder, dropped all my
eclipselink plugins, but when i'm trying to add eclipselink plug-ins to
my plugin project as a dependence, it cant found.
am i missing something?
on my eclipse preferences, the target platform points to my platform file
thanks again
Christian Soltenborn
2011-09-12 05:46:03 UTC
Permalink
Hi,

this is turning into support for an Eclipse feature, and the tycho
mailing list is not the right place for that. Please refer to an
appropriate Eclipse newsgroup for further questions.

As far as I know, the target platform works as follows: Everything added
to a target platform will be automatically downloaded and made available
for the plug-ins in your development workspace as soon as you activate
that target platform. And tycho does the same during your build - one
example of tycho reusing already existing artifacts to make your build
easy to set up.

So there's no need to put those eclipselink plug-ins anywhere inside
your workspace. If you can't add them while your target platform is
active, they are probably not contained in the target platform - check
its content.

Cheers,
Christian


Am 11.09.2011 22:42, schrieb Luiz E. (GMail):
> On 09/11/2011 01:53 PM, Christian Soltenborn wrote:
>> Hi,
>>
>> I think this is exactly what target platforms are made for. See e.g.
>> this article:
>>
>> http://kaloyanraev.blogspot.com/2011/09/sharing-pde-target-platforms-and-launch.html
>>
>>
>> Cheers,
>> Christian
>>
>>
>> Am 11.09.2011 18:46, schrieb Luiz E. (GMail):
>>> hey christian.
>>> thanks again for clarify my path :P
>>>
>>> so, i'll keep adding my plug-ins via manifest file, and tycho will take
>>> care of the rest? nice...
>>>
>>> another question...about the plug-ins, like, eclipselink. how do you
>>> manage these plug-ins?
>>> i used to drop them inside eclipse/plugins folder and add then via
>>> manifest, but i think this is not right, because i work with a team, and
>>> make them copy my plugins and drop in they plugin folder is not cool.
>>> should i make a folder inside project and add this folder to build path?
>>> VERY THANKS again :)
>>> _______________________________________________
>>> tycho-user mailing list
>>> tycho-***@eclipse.org
>>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>>>
>>
> THIS!
> exactly what i need!
> i've added a folder to my target platform like this:
> '${workspace_loc}/project_name/lib' and is this folder, dropped all my
> eclipselink plugins, but when i'm trying to add eclipselink plug-ins to
> my plugin project as a dependence, it cant found.
> am i missing something?
> on my eclipse preferences, the target platform points to my platform file
> thanks again
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
>


--
Nancy Astor: "One reason I don't drink is that I want to know when I am
having a good time."
Luiz Eduardo
2011-09-12 12:34:08 UTC
Permalink
Em 12/9/2011 10:16, Christian Soltenborn escreveu:
> Hi,
>
> this is turning into support for an Eclipse feature, and the tycho
> mailing list is not the right place for that. Please refer to an
> appropriate Eclipse newsgroup for further questions.
>
> As far as I know, the target platform works as follows: Everything added
> to a target platform will be automatically downloaded and made available
> for the plug-ins in your development workspace as soon as you activate
> that target platform. And tycho does the same during your build - one
> example of tycho reusing already existing artifacts to make your build
> easy to set up.
>
> So there's no need to put those eclipselink plug-ins anywhere inside
> your workspace. If you can't add them while your target platform is
> active, they are probably not contained in the target platform - check
> its content.
>
> Cheers,
> Christian
>
>
> Am 11.09.2011 22:42, schrieb Luiz E. (GMail):
>> On 09/11/2011 01:53 PM, Christian Soltenborn wrote:
>>> Hi,
>>>
>>> I think this is exactly what target platforms are made for. See e.g.
>>> this article:
>>>
>>> http://kaloyanraev.blogspot.com/2011/09/sharing-pde-target-platforms-and-launch.html
>>>
>>>
>>> Cheers,
>>> Christian
>>>
>>>
>>> Am 11.09.2011 18:46, schrieb Luiz E. (GMail):
>>>> hey christian.
>>>> thanks again for clarify my path :P
>>>>
>>>> so, i'll keep adding my plug-ins via manifest file, and tycho will take
>>>> care of the rest? nice...
>>>>
>>>> another question...about the plug-ins, like, eclipselink. how do you
>>>> manage these plug-ins?
>>>> i used to drop them inside eclipse/plugins folder and add then via
>>>> manifest, but i think this is not right, because i work with a team, and
>>>> make them copy my plugins and drop in they plugin folder is not cool.
>>>> should i make a folder inside project and add this folder to build path?
>>>> VERY THANKS again :)
>>>> _______________________________________________
>>>> tycho-user mailing list
>>>> tycho-***@eclipse.org
>>>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>>>>
>> THIS!
>> exactly what i need!
>> i've added a folder to my target platform like this:
>> '${workspace_loc}/project_name/lib' and is this folder, dropped all my
>> eclipselink plugins, but when i'm trying to add eclipselink plug-ins to
>> my plugin project as a dependence, it cant found.
>> am i missing something?
>> on my eclipse preferences, the target platform points to my platform file
>> thanks again
>> _______________________________________________
>> tycho-user mailing list
>> tycho-***@eclipse.org
>> https://dev.eclipse.org/mailman/listinfo/tycho-user
>>
>
ok, sorry :(
i got it, and it worked!
thanks again.

cheers
Luiz Eduardo
2011-09-12 19:46:14 UTC
Permalink
heyy again...
i know i'm being such a pain in the ass, but i want to apply good
practices is this project and any tycho material is pretty scarse. this
list is the only thing that really helps.
again, i got stuck in 'dependencies' problem.

my target definition file look like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.6"?>

<target name="Build" sequenceNumber="41">
<locations>
<location path="${workspace_loc}/br.com.german.plugin/lib"
type="Directory"/>
<location includeAllPlatforms="false" includeMode="planner"
includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110613-1736"/>
<unit id="org.eclipse.persistence.jpa.feature.group"
version="2.3.0.v20110604-r9504"/>
<unit id="org.eclipse.persistence.sdo.feature.group"
version="2.3.0.v20110604-r9504"/>
<unit id="org.eclipse.persistence.sdk.feature.group"
version="2.3.0.v20110604-r9504"/>
<repository location="http://download.eclipse.org/releases/indigo/"/>
</location>
</locations>
</target>


as seen, there's a dir '${workspace_loc}/br.com.german.plugin/lib' where
i dropped some plugins (in this case, postgresql driver plug-in)
so, as said, i only need to add plug-ins as dependencies on my MANIFEST.MF

but when i try to 'mvn clean package'...
[INFO] Scanning for projects...
[INFO] Resolving target platform for project MavenProject:
br.com.german:br.com.german.feature:1.0.0 @
C:\Java\workspaceRCP\br.com.german.feature\pom.xml
[INFO] Adding repository http://download.eclipse.org/releases/indigo/
[INFO] Adding repository http://download.eclipse.org/releases/indigo/
[WARNING] Target location type: Directory is not supported
[INFO] Adding repository (cached)
http://download.eclipse.org/releases/indigo/
[INFO] Cannot complete the request. Generating details.
[INFO]
{org.osgi.framework.executionenvironment=OSGi/Minimum-1.0,OSGi/Minimum-1.1,
osgi.ws=win32, osgi.arch=x86, osgi.os=win32,
org.eclipse.update.install.features=true,
org.osgi.framework.system.packages=}
[INFO] [Software being installed: br.com.german.feature.feature.group
1.0.0, Missing requirement: br.com.german.feature.feature.group 1.0.0
requires 'com.springsource.org.postgresql.jdbc4 8.3.604' but it could
not be found]
[ERROR] Internal error: java.lang.RuntimeException:
org.eclipse.equinox.p2.core.ProvisionException: No solution found
because the problem is unsatisfiable. -> [Help 1]

when i remove postgresql as dependency of my plug-in, the package goes
successful
i'm almost giving up on this :(
it been a week i'm crawling around for a solution :((
Davy Meers
2011-09-12 20:48:18 UTC
Permalink
Hello,
the problem is that "${workspace_loc}" is an eclipse variable. As far as i know Tycho does not know this variable and uses the text literally. (This causes the warning "[WARNING] Target location type: Directory is not supported")

I do not have a lot of experience with tycho and target platforms. What i did was the following:
1) make sure that i have every dependency in a p2 repository2) in my target platform reference only the p2 repositories
This also meant that for some dependencies which i could not find in a p2 repo, i had to make my own p2 repo and place that on an internal server.It is some extra work but fortunately i didn't have a lot of those dependencies and i could use the target definition with both eclipse pde and tycho.
There might be other options like adding the postgresql dependency to the dependencies section in the pom and add "<pomDependencies>consider</pomDependencies>" to the configuration of the tycho target-platform-configuration plugin (See also https://docs.sonatype.org/display/TYCHO/Dependency+on+pom-first+artifacts).
I think that will be the easiest (maybe the tycho folks can confirm this?).At the time i created the target platform this was not an option because eclipse PDE didn't pick up those dependencies and it was not supported yet in m2e.I think it is supported now by m2e, but i am not sure.
I hope this did help you a bit.
Otherwise feel free to ask your questions.
Regards,Davy


> Date: Mon, 12 Sep 2011 16:46:14 -0300
> From: ***@gmail.com
> To: tycho-***@eclipse.org
> Subject: Re: [tycho-user] adding plugins
>
> heyy again...
> i know i'm being such a pain in the ass, but i want to apply good
> practices is this project and any tycho material is pretty scarse. this
> list is the only thing that really helps.
> again, i got stuck in 'dependencies' problem.
>
> my target definition file look like this:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <?pde version="3.6"?>
>
> <target name="Build" sequenceNumber="41">
> <locations>
> <location path="${workspace_loc}/br.com.german.plugin/lib"
> type="Directory"/>
> <location includeAllPlatforms="false" includeMode="planner"
> includeSource="true" type="InstallableUnit">
> <unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110613-1736"/>
> <unit id="org.eclipse.persistence.jpa.feature.group"
> version="2.3.0.v20110604-r9504"/>
> <unit id="org.eclipse.persistence.sdo.feature.group"
> version="2.3.0.v20110604-r9504"/>
> <unit id="org.eclipse.persistence.sdk.feature.group"
> version="2.3.0.v20110604-r9504"/>
> <repository location="http://download.eclipse.org/releases/indigo/"/>
> </location>
> </locations>
> </target>
>
>
> as seen, there's a dir '${workspace_loc}/br.com.german.plugin/lib' where
> i dropped some plugins (in this case, postgresql driver plug-in)
> so, as said, i only need to add plug-ins as dependencies on my MANIFEST.MF
>
> but when i try to 'mvn clean package'...
> [INFO] Scanning for projects...
> [INFO] Resolving target platform for project MavenProject:
> br.com.german:br.com.german.feature:1.0.0 @
> C:\Java\workspaceRCP\br.com.german.feature\pom.xml
> [INFO] Adding repository http://download.eclipse.org/releases/indigo/
> [INFO] Adding repository http://download.eclipse.org/releases/indigo/
> [WARNING] Target location type: Directory is not supported
> [INFO] Adding repository (cached)
> http://download.eclipse.org/releases/indigo/
> [INFO] Cannot complete the request. Generating details.
> [INFO]
> {org.osgi.framework.executionenvironment=OSGi/Minimum-1.0,OSGi/Minimum-1.1,
> osgi.ws=win32, osgi.arch=x86, osgi.os=win32,
> org.eclipse.update.install.features=true,
> org.osgi.framework.system.packages=}
> [INFO] [Software being installed: br.com.german.feature.feature.group
> 1.0.0, Missing requirement: br.com.german.feature.feature.group 1.0.0
> requires 'com.springsource.org.postgresql.jdbc4 8.3.604' but it could
> not be found]
> [ERROR] Internal error: java.lang.RuntimeException:
> org.eclipse.equinox.p2.core.ProvisionException: No solution found
> because the problem is unsatisfiable. -> [Help 1]
>
> when i remove postgresql as dependency of my plug-in, the package goes
> successful
> i'm almost giving up on this :(
> it been a week i'm crawling around for a solution :((
>
>
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
Luiz E. (GMail)
2011-09-12 23:43:40 UTC
Permalink
you really helped me :)
but i still have some questions...
the best thing to do in my case is a internal p2 repository, so?
i have a dedicated server, i can do this, but first i must learn how to
do that :P
do you have any link, tutorial or other that can help me trough this?
i'll take a look on add this on my pom (parent pom, right?) actuality i
have a internal repo on nexus. i'll send pom to my nexus, and he'll
download the files i need
thanks guys, you're helping me a lot!
Davy Meers
2011-09-13 08:13:19 UTC
Permalink
Hi,
I would suggest to try the following first:
1) add the following to your pom dependencies section:

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>com.springsource.org.postgresql.jdbc4</artifactId>
<version>8.3.604</version>
</dependency>
2) Make sure in the plugin section that you have minimum the following:

<plugin>
<groupId>org.sonatype.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version> <!-- Make sure this property is defined or replace it with the tycho version you use-->
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
3) Make sure the springsource repositories are present in the repositories section of the POM:

<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>

<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
4) Try to build it

If this does not work out i would suggest to create an internal P2 repository (Note: this is not the same as a Maven repository)

Davy

> Date: Mon, 12 Sep 2011 20:43:40 -0300
> From: ***@gmail.com
> To: tycho-***@eclipse.org
> Subject: Re: [tycho-user] adding plugins
>
> you really helped me :)
> but i still have some questions...
> the best thing to do in my case is a internal p2 repository, so?
> i have a dedicated server, i can do this, but first i must learn how to
> do that :P
> do you have any link, tutorial or other that can help me trough this?
> i'll take a look on add this on my pom (parent pom, right?) actuality i
> have a internal repo on nexus. i'll send pom to my nexus, and he'll
> download the files i need
> thanks guys, you're helping me a lot!
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
Luiz Eduardo
2011-09-13 11:39:43 UTC
Permalink
hi!

i added this to my plugin pom:

<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.0-801.jdbc4</version>
</dependency>

and my parent pom is like

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>0.12.0</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>


maven has downloaded the postgre driver, its listed on Maven
Dependencies of my project. but when i try do compile with 'mvn clean
package', the following error occours:

1. ERROR in
C:\Java\workspaceRCP\br.com.german.plugin\src\br\com\german\plugin\A
ctivator.java (at line 6)
import org.postgresql.Driver;
^^^^^^^^^^^^^^
The import org.postgresql cannot be resolved

am i missing something?
Davy Meers
2011-09-13 11:56:50 UTC
Permalink
The reason is that the dependency you are using ("postgresql:postgresql:9.0-801.jdbc4") is not OSGi-compatible (if you look at the manifest you will see that no packages are exported).That is the reason why i told you to use the dependency "org.postgresql:com.springsource.org.postgresql.jdbc4:8.3.604" from the springsource repository: it is OSGi-compatible (the needed packages are exported).
> Date: Tue, 13 Sep 2011 08:39:43 -0300
> From: ***@gmail.com
> To: tycho-***@eclipse.org
> Subject: Re: [tycho-user] adding plugins
>
> hi!
>
> i added this to my plugin pom:
>
> <dependency>
> <groupId>postgresql</groupId>
> <artifactId>postgresql</artifactId>
> <version>9.0-801.jdbc4</version>
> </dependency>
>
> and my parent pom is like
>
> <plugin>
> <groupId>org.eclipse.tycho</groupId>
> <artifactId>target-platform-configuration</artifactId>
> <version>0.12.0</version>
> <configuration>
> <resolver>p2</resolver>
> <pomDependencies>consider</pomDependencies>
>
>
> maven has downloaded the postgre driver, its listed on Maven
> Dependencies of my project. but when i try do compile with 'mvn clean
> package', the following error occours:
>
> 1. ERROR in
> C:\Java\workspaceRCP\br.com.german.plugin\src\br\com\german\plugin\A
> ctivator.java (at line 6)
> import org.postgresql.Driver;
> ^^^^^^^^^^^^^^
> The import org.postgresql cannot be resolved
>
> am i missing something?
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
Luiz Eduardo
2011-09-13 12:08:21 UTC
Permalink
hmm, got it...
but m2e says '13/09/11 12h7min3s GMT: Missing artifact
org.postgresql:com.springsource.org.postgresql.jdbc4:jar:8.3.604:compile'

i added the repositories to my plugin pom, and tried to add them to
settings.xml. none os them worked :(
Davy Meers
2011-09-14 09:26:24 UTC
Permalink
Hello,
Can you check your maven settings? Make sure you do not have a catch-all mirror setup.
Something like:
<mirror> <!--This sends everything else to nexus --> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>someurl</url> </mirror>
I also created a minimal OSGi project that uses the postgresql dependency. (I have no problems building it with the default maven settings)Have a look at https://github.com/mudelta/Tycho-Example-PomDependencies
Davy

> Date: Tue, 13 Sep 2011 09:08:21 -0300
> From: ***@gmail.com
> To: tycho-***@eclipse.org
> Subject: Re: [tycho-user] adding plugins
>
> hmm, got it...
> but m2e says '13/09/11 12h7min3s GMT: Missing artifact
> org.postgresql:com.springsource.org.postgresql.jdbc4:jar:8.3.604:compile'
>
> i added the repositories to my plugin pom, and tried to add them to
> settings.xml. none os them worked :(
>
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
Luiz Eduardo
2011-09-14 11:12:59 UTC
Permalink
hey :)
here are my settings.xml: https://gist.github.com/1216325
i'll take a look into your project.
but why are you using variables like $project_loc if you said that tycho
doesn't recognize they?
thanks a lot :)
Davy Meers
2011-09-14 11:54:23 UTC
Permalink
You are using a nexus server as a mirror:
<mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://192.168.0.10:8080/nexus/content/groups/public/</url></mirror>
The following repositories have to be added to nexus. You have to ask this to the administrator of the nexus server.
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>

<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>

I suggest you remove the gist because it contains your password for your proxy server.

About the $project_loc:
Tycho will use the dependency from the pom and ignore the $project_loc (it will issue a warning though).The problem is neither M2E (with the Tycho extension) nor PDE pick up the dependency from the POM. This means you still need that jar in your lib folder and link to it from within your target platform.Otherwise you will get problems in your eclipse environment.
> Date: Wed, 14 Sep 2011 08:12:59 -0300
> From: ***@gmail.com
> To: tycho-***@eclipse.org
> Subject: Re: [tycho-user] adding plugins
>
> hey :)
> here are my settings.xml: https://gist.github.com/1216325
> i'll take a look into your project.
> but why are you using variables like $project_loc if you said that tycho
> doesn't recognize they?
> thanks a lot :)
>
>
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
Luiz Eduardo
2011-09-14 12:11:55 UTC
Permalink
i've already added this repository to my nexus server...i'ts working now...
in m2e, i've enabled dependeceny management, and now, when i add the
following dep. to my pom:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>${javax.persistence.version}</version>
</dependency>

m2e downloads my javax.persistence jar, and drops him inside 'Maven
Dependencies' lib. same goest to postgresql driver and eclipselink jars.

now i added the 'lib' folder to my target platform, but when i try to
start my app:

Caused by: java.lang.NoClassDefFoundError: org/postgresql/Driver
at
br.com.german.plugin.entityManager.ECFEntityManager.init(ECFEntityManager.java:21)
at
br.com.german.plugin.entityManager.ECFEntityManager.createEntityManager(ECFEntityManager.java:39)
at br.com.german.plugin.Activator.start(Activator.java:37)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 34 more

i'm using com.springsource.org.postgresql.jdbc4-8.3.604 jar
seems like eclipse doesn't recognize my libs folder or something...

my target:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.6"?>

<target name="Germantech" sequenceNumber="51">
<locations>
<location includeAllPlatforms="false" includeMode="planner"
includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110613-1736"/>
<repository location="http://download.eclipse.org/releases/indigo/"/>
</location>
<location path="${project_loc}/lib" type="Directory"/>
</locations>
</target>

when i try mvn clean install, tycho still can't find my libs

[INFO] Compiling 8 source files to
C:\Java\workspaceRCP\br.com.german.plugin\target\classes
----------
1. ERROR in
C:\Java\workspaceRCP\br.com.german.plugin\src\br\com\german\plugin\Activator.java
(at line 3)
import javax.persistence.Persistence;
^^^^^^^^^^^^^^^^^
The import javax.persistence cannot be resolved

but now, i feel like i'm getting the point :) things are getting clear
around my head :)
i'm excited with what i'll be able to do with these things :P
thanks a lot
Davy Meers
2011-09-14 12:26:02 UTC
Permalink
I am not sure about the target platform in eclipse. Are the target platform file and the lib folder contained in the same project?(Note that that problem is not really a Tycho problem and it does not really belong on this list).
About the dependency org.eclipse.persistence:javax.persistence:
It is not available in the Maven Central repository. You have to add the EclipseLink repository to your nexus: http://download.eclipse.org/rt/eclipselink/maven.repo
See also http://stackoverflow.com/questions/3122135/cant-find-the-org-eclipse-persistence-maven-dependency and http://wiki.eclipse.org/EclipseLink/Maven
> Date: Wed, 14 Sep 2011 09:11:55 -0300
> From: ***@gmail.com
> To: tycho-***@eclipse.org
> Subject: Re: [tycho-user] adding plugins
>
> i've already added this repository to my nexus server...i'ts working now...
> in m2e, i've enabled dependeceny management, and now, when i add the
> following dep. to my pom:
> <dependency>
> <groupId>org.eclipse.persistence</groupId>
> <artifactId>javax.persistence</artifactId>
> <version>${javax.persistence.version}</version>
> </dependency>
>
> m2e downloads my javax.persistence jar, and drops him inside 'Maven
> Dependencies' lib. same goest to postgresql driver and eclipselink jars.
>
> now i added the 'lib' folder to my target platform, but when i try to
> start my app:
>
> Caused by: java.lang.NoClassDefFoundError: org/postgresql/Driver
> at
> br.com.german.plugin.entityManager.ECFEntityManager.init(ECFEntityManager.java:21)
> at
> br.com.german.plugin.entityManager.ECFEntityManager.createEntityManager(ECFEntityManager.java:39)
> at br.com.german.plugin.Activator.start(Activator.java:37)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
> ... 34 more
>
> i'm using com.springsource.org.postgresql.jdbc4-8.3.604 jar
> seems like eclipse doesn't recognize my libs folder or something...
>
> my target:
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <?pde version="3.6"?>
>
> <target name="Germantech" sequenceNumber="51">
> <locations>
> <location includeAllPlatforms="false" includeMode="planner"
> includeSource="true" type="InstallableUnit">
> <unit id="org.eclipse.rcp.sdk.id" version="3.7.0.I20110613-1736"/>
> <repository location="http://download.eclipse.org/releases/indigo/"/>
> </location>
> <location path="${project_loc}/lib" type="Directory"/>
> </locations>
> </target>
>
> when i try mvn clean install, tycho still can't find my libs
>
> [INFO] Compiling 8 source files to
> C:\Java\workspaceRCP\br.com.german.plugin\target\classes
> ----------
> 1. ERROR in
> C:\Java\workspaceRCP\br.com.german.plugin\src\br\com\german\plugin\Activator.java
> (at line 3)
> import javax.persistence.Persistence;
> ^^^^^^^^^^^^^^^^^
> The import javax.persistence cannot be resolved
>
> but now, i feel like i'm getting the point :) things are getting clear
> around my head :)
> i'm excited with what i'll be able to do with these things :P
> thanks a lot
> _______________________________________________
> tycho-user mailing list
> tycho-***@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/tycho-user
Luiz Eduardo
2011-09-14 12:31:45 UTC
Permalink
yep, target platform and lib folder are on the same project...
now, i'm facing another problem, but this one is eclipse related :)
gonna try eclipse forums
thanks for the help, i'll keep trying here :)

cheers
Continue reading on narkive:
Loading...