Giter Club home page Giter Club logo

alitheia-core's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alitheia-core's Issues

Deploy third party library in AC

Please document the detailed process that should be followed in order to deploy a third party library in alitheia core as an OSGi bundle.

After careful examination of the other approaches, along with @eligu, and by taking into account the AC plugin creation guidelines, we believe that in order to be able to use the libraries that we need, they must be incorporated in AC as a separate OSGi bundle. But after many attempts the result is always a build failure.

Could you provide a detailed guide about the process that should be followed for the successful configuration of the pom.xml and osgi.bnd files?

Problem while updating a maven project

I get an error while trying to update a module via maven->update project

An internal error occurred during: "Updating Maven Project".
Unsupported IClasspathEntry kind=4

maven_problem

Check Events

Update events (GitHub parser, AlitheiaCore API, DB)

Type gr.aueb.metrics.findbugsscala cannot be resolved to a type

I encounter the following problem after importing Alitheia in Eclipse as a maven project.
(The alitheia version is the latest one, where the ArtifactID Eclipse problem has been resolved)

Description: gr.aueb.metrics.findbugsscala cannot be resolved to a type
Resource: Activator.java
Path: /findbugs/src/main/java/gr/aueb/metrics/findbugs
Location: line 49

I also noticed that the path /findbugs/src/main/java/gr/aueb/metrics/findbugs is from the module metrics which is not a Java project in eclipse as you can see in the attached image. So probably this is the problem. Eclipse cannot refer to a Class in the workspace with the class not being inside a Java Project

metrics

Problem while installing Plugins

Playing around with Alitheia-Core, getting the source code, importing it to Eclipse and so on, while I executed alitheia core (through m2e mvn pax:provision), it could't install the plugin at Plugin tab. The message I got was:
ERROR - No plug-in implements metric Wc.loc which is required by Module size metrics
ERROR - Plug-in installation failed.
After making a clean install and changing the default DB to MySql and running from cmd I keept getting the same problem. Performing two or more restart, then it started to install the plugins (I verified it in MySql), however the problem was occasionally appearing, after that. Below is a snapshot of the logs at the moment the problem was happening:

ERROR - No plug-in implements metric Wc.loc which is required by Module size metrics
ERROR - Plug-in installation failed
ERROR - Can not modify property (CMF_threshold) for plugin (Developer Contribution
ERROR - null: eu.sqooss.service.pa.PluginInfo.addConfigEntry(PluginInfo.java:384) eu.sqooss.service.abstractmetric.AbstractMetric.addConfigEntry(AbstractMetric.java:748) eu.sqooss.metrics.contrib.ContributionMetricImpl.install(ContributionMetricImpl.java:108) eu.sqooss.impl.service.pa.PAServiceImpl.installPlugin(PAServiceImpl.java:463) eu.sqooss.impl.service.pa.PAServiceImpl.installPlugin(PAServiceImpl.java:436) eu.sqooss.impl.service.webadmin.PluginsView.render(PluginsView.java:163) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389) org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378) org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270) org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252) org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:339) org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) org.apache.velocity.Template.merge(Template.java:328) org.apache.velocity.Template.merge(Template.java:235) eu.sqooss.impl.service.webadmin.AdminServlet.sendPage(AdminServlet.java:295) eu.sqooss.impl.service.webadmin.AdminServlet.doGet(AdminServlet.java:196) eu.sqooss.impl.service.webadmin.AdminServlet.doPost(AdminServlet.java:233) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) javax.servlet.http.HttpServlet.service(HttpServlet.java:820) org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) org.mortbay.jetty.servlet.OsgiServletHolder.handle(OsgiServletHolder.java:101) org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363) org.mortbay.jetty.servlet.OsgiServletHandler.handle(OsgiServletHandler.java:117) org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) org.mortbay.jetty.Server.handle(Server.java:324) org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741) org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213) org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403) org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
ERROR - No plug-in implements metric EMCC_TOTAL which is required by Maintainability Index
ERROR - Plug-in installation failed
ERROR - No plug-in implements metric ISSRCMOD which is required by Maintainability Index
ERROR - Plug-in installation failed
ERROR - No plug-in implements metric ISSRCMOD which is required by Maintainability Index
ERROR - Plug-in installation failed

EDIT: Probably this is not an Alitheia-Core issue. After looking at the code, I see that, when installing a metric plugin, if that plugin has a dependency declared at annotation level (@MetricDecl) than the dependency must be installed first. However, I think there is no way how can user understand which module requires which, in our case we can see it by the code, at least I didn't find any.

Metric cannot synchronize

With project JConvert loaded, I click on the Synchronize button for the "Project size metrics", no calculation was triggered and the failed jobs counter increased by one.

This is also a bug that is not consistent but appears randomly

Here is a snapshot of the Job failure statistics panel:

job_failure_panel

Projects tab cause error HTTP 500

After the import of a project and while trying to click on the Project tab i get the following HTTP Error in the browser.

HTTP ERROR: 500

Invocation of method 'render' in class eu.sqooss.impl.service.webadmin.ProjectsView threw exception org.hibernate.LazyInitializationException: could not initialize proxy - no Session at projects.html[line 8, column 23]

RequestURI=/projects
Caused by:

org.apache.velocity.exception.MethodInvocationException: Invocation of method 'render' in class eu.sqooss.impl.service.webadmin.ProjectsView threw exception org.hibernate.LazyInitializationException: could not initialize proxy - no Session at projects.html[line 8, column 23]
at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:339)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at eu.sqooss.impl.service.webadmin.AdminServlet.sendPage(AdminServlet.java:295)
at eu.sqooss.impl.service.webadmin.AdminServlet.doGet(AdminServlet.java:196)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.OsgiServletHolder.handle(OsgiServletHolder.java:101)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
at org.mortbay.jetty.servlet.OsgiServletHandler.handle(OsgiServletHandler.java:117)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
Caused by: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:191)
at eu.sqooss.service.db.MetricType_$$javassist_34.getEnumType(MetricType$$_javassist_34.java)
at eu.sqooss.service.db.Metric.isEvaluated(Metric.java:259)
at eu.sqooss.service.db.StoredProject.isEvaluated(StoredProject.java:468)
at eu.sqooss.impl.service.webadmin.ProjectsView.createFrom(ProjectsView.java:499)
at eu.sqooss.impl.service.webadmin.ProjectsView.render(ProjectsView.java:160)
at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
... 24 more

Caused by:

org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:191)
at eu.sqooss.service.db.MetricType_$$javassist_34.getEnumType(MetricType$$_javassist_34.java)
at eu.sqooss.service.db.Metric.isEvaluated(Metric.java:259)
at eu.sqooss.service.db.StoredProject.isEvaluated(StoredProject.java:468)
at eu.sqooss.impl.service.webadmin.ProjectsView.createFrom(ProjectsView.java:499)
at eu.sqooss.impl.service.webadmin.ProjectsView.render(ProjectsView.java:160)
at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:339)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at eu.sqooss.impl.service.webadmin.AdminServlet.sendPage(AdminServlet.java:295)
at eu.sqooss.impl.service.webadmin.AdminServlet.doGet(AdminServlet.java:196)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.OsgiServletHolder.handle(OsgiServletHolder.java:101)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
at org.mortbay.jetty.servlet.OsgiServletHandler.handle(OsgiServletHandler.java:117)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)

Import Projects from GitHub

Until now we can import projects from SVN repos. We have to be able import projects from GithHub. For this we have to make conversions in the database and in some metrics.

Website is down

The README says, "More documentation is always available at the project's web site at http://www.sqo-oss.org".

The website is down.

This makes it hard for me to get started.

Issue Adding Project

The problem I will describe is actually more of a "wrong" implementation than an issue with the code.

In order to add a project and to experiment with the code I decided to add the Commons IO from Apache Software Foundation. So I specified the following parameters (at Add Project view):

Project Name: commons-io
Home Page: http://commons.apache.org/proper/commons-io/
Source code: svn-http://svn.apache.org/repos/asf/commons/proper/io

(All the remaining fields were left blank)

After executing I got the following error (from Logs tab):

ERROR - Error executing action addpr, id 1 Cause:Accessor failed: null
ERROR - Accessor failed: null: eu.sqooss.service.admin.AdminActionBase.error(AdminActionBase.java:107) eu.sqooss.service.admin.actions.AddProject.execute(AddProject.java:176) eu.sqooss.impl.service.admin.AdminServiceImpl.execute(AdminServiceImpl.java:111) eu.sqooss.impl.service.webadmin.ProjectsView.addProject(ProjectsView.java:172) eu.sqooss.impl.service.webadmin.ProjectsView.render(ProjectsView.java:145) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389) org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378) org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270) org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252) org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:339) org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) org.apache.velocity.Template.merge(Template.java:328) org.apache.velocity.Template.merge(Template.java:235) eu.sqooss.impl.service.webadmin.AdminServlet.sendPage(AdminServlet.java:295) eu.sqooss.impl.service.webadmin.AdminServlet.doGet(AdminServlet.java:196) eu.sqooss.impl.service.webadmin.AdminServlet.doPost(AdminServlet.java:233) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) javax.servlet.http.HttpServlet.service(HttpServlet.java:820) org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) org.mortbay.jetty.servlet.OsgiServletHolder.handle(OsgiServletHolder.java:101) org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363) org.mortbay.jetty.servlet.OsgiServletHandler.handle(OsgiServletHandler.java:117) org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) org.mortbay.jetty.Server.handle(Server.java:324) org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741) org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213) org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403) org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)

I tried to debug the error by remote debugging the method:
eu.sqooss.service.admin.actions.AddProject.execute

The problem was at line 151 of this method, here is the stack trace:
java.util.NoSuchElementException
at java.util.ArrayList$Itr.next(Unknown Source)
at eu.sqooss.plugins.tds.svn.SVNAccessorImpl.resolveRevision(SVNAccessorImpl.java:320)
at eu.sqooss.plugins.tds.svn.SVNAccessorImpl.getHeadRevision(SVNAccessorImpl.java:356)
at eu.sqooss.service.admin.actions.AddProject.execute(AddProject.java:151)
at eu.sqooss.impl.service.admin.AdminServiceImpl.execute(AdminServiceImpl.java:111)
at eu.sqooss.impl.service.webadmin.ProjectsView.addProject(ProjectsView.java:172)
at eu.sqooss.impl.service.webadmin.ProjectsView.render(ProjectsView.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:339)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at eu.sqooss.impl.service.webadmin.AdminServlet.sendPage(AdminServlet.java:295)
at eu.sqooss.impl.service.webadmin.AdminServlet.doGet(AdminServlet.java:196)
at eu.sqooss.impl.service.webadmin.AdminServlet.doPost(AdminServlet.java:233)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.OsgiServletHolder.handle(OsgiServletHolder.java:101)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
at org.mortbay.jetty.servlet.OsgiServletHandler.handle(OsgiServletHandler.java:117)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)

Looking at the stack trace we will see that the problem comes from:
eu.sqooss.plugins.tds.svn.SVNAccessorImpl.resolveRevision line 320.

If we see at the implementation we will realize that the call at:
log = getSVNLog("", svnrev.getSVNRevision(), -1) (line 319)
will return an empty list.
So the first bug here is that we have an uncatched exception, because we call the iterator().next(), method on an empty list!!!

Having some experience with svn and SVNKit and looking at the implementation of method: List getSVNLog(String repoPath, long revstart, long revend)
(SVNAccessorImpl) it seems that you are trying to call:
org.tmatesoft.svn.core.io.SVNRepository.log() with the startRev same as the latest revision of the repository and the startRev -1. In this case, the implementation of SVNKit's SVNRepository.log() will put endRev = startRev, so you are expected to get the latest SVNLogEntry. However the call to that method return no log entry in our case, why?
The problems lies at the fact that ASF has a central SVN repository with a lot of projects there, so the latest revision in our case doesn't correspond to a change made to the path /commons/proper/io (in repo) that is why it returns no log entries. However when we call SVNRepository.getLatestRevision() it will return the latest revision of the repository, and in our case because someone has made a change to another project within ASF's repository all the repo's tree revision number will equal to the latest commit number.
In other words there is a problem with the implementation of SVNAccessorImpl:
If we have a repository with lot of projects we cant add one of those projects to Alitheia. I believe that this is a serious limitation, having in mind that ASF is a very valuable repository of OSS projects, especially of Java based projects (look at Apache Commons).

I think there is a workaround here. Here is the description:
Let say we have a repo with multiply projects and we want to get the last commit of a certain project (suppose ASF's repo). We create the repository object for that project (commons-io):

    DAVRepositoryFactory.setup();
    String url = "http://svn.apache.org/repos/asf/commons/proper/io";
    SVNURL svnurl = SVNURL.parseURIDecoded(url);
    SVNRepository repository = SVNRepositoryFactory.create(svnurl);
    ISVNAuthenticationManager authenticationManager =     
                                    SVNWCUtil.createDefaultAuthenticationManager();
    repository.setAuthenticationManager(authenticationManager);

In order to get the last log of the repo we have:

    long lastRev = repository.getLatestRevision();

The lastRev, however, might be a revision that doesn't affect the project, so in your implementation it can not be resolved (see SVNAccessorImpl.resolveRevision()).
In order to get (or let say to resolve) the last revision that affected any of the files/folder under /commons/proper/io we can take all the logs:

Collection<SVNLogEntry> logs = repository.log(new String[]{""}, null, 0, lastRev, true, true);

and the last revision is the last item at logs collection. Or a better implementation would be:

repository.log(new String[]{""}, lastRev, 0, true, true, 1, new ISVNLogEntryHandler() {
        @Override
        public void handleLogEntry(SVNLogEntry svnLogEntry) throws SVNException {
            System.out.println("Last rev (handler):" + svnLogEntry.getRevision());
        }
    });

The last implementation, will avoid to download all log entries, and it will start in descending order, so the last revision will be the first entry that is passed at handler (look at parameters, we have set lastRev, 0). With this code you can easily resolve last revisions in repositories such as this, we are working with. I think the only method that must be changed would be the:

private long getHeadSVNRevision() throws InvalidRepositoryException {
    long endRevision = -1;
    if (svnRepository == null) {
        connectToRepository();
    }
    try {
        long lastRev = svnRepository.getLatestRevision();
        final Rev revision = new Rev(-1);
        svnRepository.log(new String[]{""}, lastRev, 0, true, true, 1, new ISVNLogEntryHandler() {
            @Override
            public void handleLogEntry(SVNLogEntry svnLogEntry) throws SVNException {
                revision.rev = svnLogEntry.getRevision();
            }
        });
        endRevision = revision.rev;
    } catch (SVNException e) {
        logger.warn("Could not get latest revision of " + url
                + e.getMessage());
        throw new InvalidRepositoryException(url, e.getMessage());
    }

    return endRevision;
}

private static class Rev { long rev; Rev(long r) { rev = r; } }

In my case it works, however, I cant say for sure if it affects other components of alitheia because, I haven't managed to Add Project (it can't find a BTS accessor and Mail accessor so it throws exceptions) so I cant Update All and try some metrics (or in the best scenario I haven't any test cases to run against).
*It is very strange the procedure of how should someone can Add Project *

EDIT:
The new implementation of getHeadSVNRevision() will work the same as the previous one if there is a "one project per repo", it will return the HEAD of the whole repo, however if there is a "multiply projects per repo" it will return the last log that affected any of the files under the path that scm.source URL is pointing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.