Problem downloading maven dependencies

13 views
Skip to first unread message

Alain Désilets

unread,
Jul 10, 2019, 2:39:39 PM7/10/19
to dkpro-core-developers
Hi, this is my first post to this list.

I found a bug in the BratWriter and want to fix it. I git cloned the module dkpro-core-api-io-asl and imported it into Eclipse. I then did a Maven Update, but Eclipse reports a bunch of errors along the following lines:

---------
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project [36mdkpro-core-api-io-asl [m: [1;31mCould not resolve dependencies for project org.dkpro.core:dkpro-core-api-io-asl:jar:2.0.0-SNAPSHOT: The following artifacts could not be resolved:
org.dkpro.core:dkpro-core-api-resources-asl:jar:2.0.0-SNAPSHOT,
and so on
---------

When I look for the artifact in my .m2 directory, I find that the jar is not there. Only *.lastUpdated files. For example:

----
$ ls ~/.m2/repository/org/dkpro/core/dkpro-core-api-resources-asl/2.0.0-SNAPSHOT/
dkpro-core-api-resources-asl-2.0.0-SNAPSHOT-sources.jar.lastUpdated
dkpro-core-api-resources-asl-2.0.0-SNAPSHOT.jar.lastUpdated
dkpro-core-api-resources-asl-2.0.0-SNAPSHOT.pom.lastUpdated
m2e-lastUpdated.properties
resolver-status.properties
----

Usually, when I get this kind of .lastUpdated files, it means that the connection to the maven repository timed out or something. This happens a lot when I use my employer's VPN (which is painfully slow).

But in this case, I have tried Maven update (after deleting .m2/repository/org/dkpro/core) with three different networks and I still get those problems.

Are other folks getting this problem?

Thx.

Alain

Alain Désilets

unread,
Jul 10, 2019, 6:03:29 PM7/10/19
to dkpro-core-developers
I made some progress on this but I am now stuck with a different problem.

Basically, I deleted my .m2/repository/dkpro, then went to my dkpro-core git directory and did the following at the command line:

mvn clean
mvn install -DskipTests

Then I imported the projects in Eclipse, and most of them seem OK. In particular, the one I am need to modify (dkpro-core-api-io-asl) does not show any errors.

However, when I try to do a mvn install on that project, I get the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:analyze-only (default) on project dkpro-core-api-io-asl: Dependency problems found -> [Help 1]


Any idea what might be causing the problem?

Thx.

Richard Eckart de Castilho

unread,
Jul 11, 2019, 1:54:02 AM7/11/19
to dkpro-core...@googlegroups.com
On 11. Jul 2019, at 00:03, Alain Désilets <alainde...@gmail.com> wrote:
>
> Then I imported the projects in Eclipse, and most of them seem OK. In particular, the one I am need to modify (dkpro-core-api-io-asl) does not show any errors.

The dkpro-core-api-io-asl contains generic IO code. The BratReader/BratWriter classes are in the dkpro-core-io-brat-asl module.

> However, when I try to do a mvn install on that project, I get the following error:
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:analyze-only (default) on project dkpro-core-api-io-asl: Dependency problems found -> [Help 1]
>
>
> Any idea what might be causing the problem?

Declaring too few or too many dependencies in the POM can cause problems for downstream users:

- If there are too many dependencies (i.e. dependencies are declared which are not really used) then it might unnecessarily cause dependency version conflicts with other libraries being used in a client project.

- If there are too few dependencies, it might be that Maven ends up preferring an incompatible version referenced elsewhere in a client project.

So the rule is: all and only dependencies which are directly referenced by the source code must be declared in the POM.

The maven dependency plugin enforces this rule. It also prints which are the offending dependencies you should add/remove, although you might have to scroll back to just before the reactor build summary to find that information in the logs.

Cheers,

-- Richard

Alain Désilets

unread,
Jul 12, 2019, 6:10:50 AM7/12/19
to dkpro-core-developers
Thx Richard, very helpful reply.

> > Then I imported the projects in Eclipse, and most of them seem OK. In particular, the one I am need to modify (dkpro-core-api-io-asl) does not show any errors.
>
> The dkpro-core-api-io-asl contains generic IO code. The BratReader/BratWriter classes are in the dkpro-core-io-brat-asl module.

I know, but the problem I am having is caused by method getRelativePath() which BratWriter inherits from JCasFileWriter_BaseImpl. The latter is in dkpro-core-api-io-asl.


> Declaring too few or too many dependencies in the POM can cause problems for downstream users:
>
> - If there are too many dependencies (i.e. dependencies are declared which are not really used) then it might unnecessarily cause dependency version conflicts with other libraries being used in a client project.
>
> - If there are too few dependencies, it might be that Maven ends up preferring an incompatible version referenced elsewhere in a client project.
>
> So the rule is: all and only dependencies which are directly referenced by the source code must be declared in the POM.
>
> The maven dependency plugin enforces this rule. It also prints which are the offending dependencies you should add/remove, although you might have to scroll back to just before the reactor build summary to find that information in the logs.
>
> Cheers,

Thx, that clarifies things.

With this hint, I was able to locate the culprit dependancy, and get dkpro-core to work. But it was no picnic. In the end, I found what helped was to do all the mvn commands from Terminal before importing the projects into eclipse.

I will submit a pull request for my fix as soon as my employer has signed the DKPro Contributor agreement.

Cheers.

>
> -- Richard

Richard Eckart de Castilho

unread,
Jul 13, 2019, 4:01:45 PM7/13/19
to dkpro-core-developers
On 12. Jul 2019, at 12:10, Alain Désilets <alainde...@gmail.com> wrote:
>
> With this hint, I was able to locate the culprit dependancy, and get dkpro-core to work. But it was no picnic. In the end, I found what helped was to do all the mvn commands from Terminal before importing the projects into eclipse.

Which mvn commands did you run?

-- Richard

Richard Eckart de Castilho

unread,
Jul 13, 2019, 4:09:04 PM7/13/19
to dkpro-core-developers
On 12. Jul 2019, at 12:10, Alain Désilets <alainde...@gmail.com> wrote:
>
>>> Then I imported the projects in Eclipse, and most of them seem OK. In particular, the one I am need to modify (dkpro-core-api-io-asl) does not show any errors.
>>
>> The dkpro-core-api-io-asl contains generic IO code. The BratReader/BratWriter classes are in the dkpro-core-io-brat-asl module.
>
> I know, but the problem I am having is caused by method getRelativePath() which BratWriter inherits from JCasFileWriter_BaseImpl. The latter is in dkpro-core-api-io-asl.

It is a good idea to open an issue for problems you encounter. If you plan to do a PR later, you'll need to have an issue anyway that you can reference in your commit comments.

-- Richard

Alain Désilets

unread,
Jul 13, 2019, 6:09:39 PM7/13/19
to dkpro-core...@googlegroups.com
mvn clean
Followed by
mvn install -DskipTests

--
You received this message because you are subscribed to a topic in the Google Groups "dkpro-core-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dkpro-core-developers/kt14TFmN6Sg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dkpro-core-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dkpro-core-developers/3FA06CE8-267E-4C3C-9C8B-A237A20D5C4B%40gmail.com.

Alain Désilets

unread,
Jul 13, 2019, 6:10:24 PM7/13/19
to dkpro-core...@googlegroups.com
Ok thx. I will write up an issue.

--
You received this message because you are subscribed to a topic in the Google Groups "dkpro-core-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dkpro-core-developers/kt14TFmN6Sg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dkpro-core-devel...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages