JPlag - Detecting Software Plagiarism
Java GAP HTML ANTLR Scheme Shell
Switch branches/tags
Clone or download
lama0206 Merge pull request #35 from mutax/feature_csvexport
adding csv export for summaries
Latest commit 16dceff Jun 4, 2018
Permalink
Failed to load latest commit information.
jplag.adminTool Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.atujplag Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.frontend-utils change all files "iso-8859-1" to "UTF-8" Aug 16, 2017
jplag.frontend.chars Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.frontend.cpp Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.frontend.csharp-1.2 change all files "iso-8859-1" to "UTF-8" Aug 16, 2017
jplag.frontend.java-1.1exp Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.frontend.java-1.2 Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.frontend.java-1.5 change all files "iso-8859-1" to "UTF-8" Aug 16, 2017
jplag.frontend.java-1.7 Minor changes Nov 10, 2016
jplag.frontend.python-3 Update Python frontend May 30, 2017
jplag.frontend.scheme Fix Scheme suffixes Nov 21, 2016
jplag.frontend.text Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.homepage change all files "iso-8859-1" to "UTF-8" Aug 16, 2017
jplag.parent Add support for python3 (Issue #6) Oct 25, 2016
jplag.utils Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.webService Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag.webServiceClientTutorial Initial commit: webservice client tutorial Mar 22, 2015
jplag.wsClient Set the correct relativePath to project parent POMs. Jan 29, 2016
jplag Merge pull request #35 from mutax/feature_csvexport Jun 4, 2018
maven-libs/com/sun/javaws Add Sun's webservice lib for atujplag and admintool Mar 22, 2015
.gitignore Ignore eclipse's settings Mar 21, 2015
.travis.yml Add travis CI configuration Jun 12, 2017
LICENSE Add license Mar 27, 2015
README.md root_dir is now optional Sep 19, 2017
pom.xml Add support for python3 (Issue #6) Oct 25, 2016

README.md

Download and Run JPlag

Download a released version - all releases are single-JAR releases.

Type java -jar jplag-yourVersion.jar in a console to see the command line options. The options as of 2017/09/17 are:

JPlag (Version 2.11.9-SNAPSHOT), Copyright (c) 2004-2017 KIT - IPD Tichy, Guido Malpohl, and others.
Usage: JPlag [ options ] [<root-dir>] [-c file1 file2 ...]
 <root-dir>        The root-directory that contains all submissions

options are:
 -v[qlpd]        (Verbose)
                 q: (Quiet) no output
                 l: (Long) detailed output
                 p: print all (p)arser messages
                 d: print (d)etails about each submission
 -d              (Debug) parser. Non-parsable files will be stored.
 -S <dir>        Look in directories <root-dir>/*/<dir> for programs.
                 (default: <root-dir>/*)
 -s              (Subdirs) Look at files in subdirs too (default: deactivated)

 -p <suffixes>   <suffixes> is a comma-separated list of all filename suffixes
                 that are included. ("-p ?" for defaults)

 -o <file>       (Output) The Parserlog will be saved to <file>
 -x <file>       (eXclude) All files named in <file> will be ignored
 -t <n>          (Token) Tune the sensitivity of the comparison. A smaller
                 <n> increases the sensitivity.
 -m <n>          (Matches) Number of matches that will be saved (default:20)
 -m <p>%         All matches with more than <p>% similarity will be saved.
 -r <dir>        (Result) Name of directory in which the web pages will be
                 stored (default: result)
 -bc <dir>       Name of the directory which contains the basecode (common framework)
 -c [files]      Compare a list of files.
 -l <language>   (Language) Supported Languages:
                 java17 (default), java15, java15dm, java12, java11, python3, c/c++, c#-1.2, char, text, scheme

Example

Assume that we want to check students' solutions that are written in Java 1.7.

Each student solution is in its own directory, say student1, student2, and so on. All solutions are in a common directory, say exercise1.

To run JPlag, simply type java -jar jplag-yourVersion.jar -l java17 -r /tmp/jplag_results_exercise1/ -s /path/to/exercise1

  • -l java17 tells JPlag to use the frontend for Java 1.7
  • -s tells JPlag to recurse into subdirectories; as we assume Java projects, we'll very likely encounter subdirectories such as student1/src/
  • -r /tmp/jplag_results_exercise1 tells JPlag to store the results in the directory /tmp/jplag_results_exercise1

Note: You have to specify the language exactly as they are printed by JPlag (running JPlag without command line arguments prints all available languages - and other options). E.g., if you want to process C++ files, you have specify -l c/c++ as language option.

Options

-x <file> (eXclude) All files named in <file> will be ignored

The option -x requires an exclusion list saved as <file>. The exclusion list contains a number of suffixes. JPlag will ignore all files that end with one of the suffixes.

-c [files] (Compare) Compare a list of files

Example: java -jar jplag-yourVersion.jar -l java17 -c student1_file student2_file student3_file This option must be the last one. JPlag will compare just a list of files pairwise.

Building JPlag

To build and run a local installation of JPlag, you can use the pom.xml in this directory (aggregator). It builds JPlag and the available frontends.

To generate single modules run mvn clean generate-sources package in the base directory; if you want a single file then run mvn clean generate-sources assembly:assembly inside the jplag directory. You will find the JARs in the respective target directories. If you build a single JAR, it will be generated in jplag/target.

Web Service

Installing, running and maintaining a local web service is not recommended as the web service uses outdated libraries and (really) needs polishing.

If you want to do it anyway: atujplag is the client, webservice is the - yepp - web service.

Improving JPlag

We're happy to incorporate all improvements to JPlag into this code base. Feel free to fork the project and send pull requests.

Adding new languages

Adding a new language frontend is quite simple. Have a look at one of the jplag.frontend projects. All you need is a parser for the language (e.g., for ANTLR or for JavaCC) and a few lines of code that sends the tokens (that are generated by the parser) to JPlag.