diff --git a/doc/_data/sidebar_doc.yml b/doc/_data/sidebar_doc.yml
index 2c93dadcda3..5f8c2b717c5 100755
--- a/doc/_data/sidebar_doc.yml
+++ b/doc/_data/sidebar_doc.yml
@@ -68,6 +68,13 @@ entries:
version: all
items:
+ - title: From Java
+ url: /launcher.html
+ audience: writers, designers
+ platform: all
+ product: all
+ version: all
+
- title: Command Line
url: /command_line.html
audience: writers, designers
@@ -75,14 +82,14 @@ entries:
product: all
version: all
- - title: Maven
+ - title: From Maven Plugin
url: /maven.html
audience: writers, designers
platform: all
product: all
version: all
- - title: Gradle
+ - title: From Gradle Plugin
url: /gradle.html
audience: writers, designers
platform: all
diff --git a/doc/faq.md b/doc/faq.md
index ccba7ded76f..74f97121ed9 100644
--- a/doc/faq.md
+++ b/doc/faq.md
@@ -25,22 +25,6 @@ See .
The Spoon metamodel consists of all interfaces that are in packages `spoon.reflect.declaration` (structural part: classes, methods, etc.) and `spoon.reflect.code` (behavioral part: if, loops, etc.).
-### How to get a Spoon model programmatically?
-
-```java
-Launcher spoon = new Launcher();
-spoon.addInputResource("src/test/resources/spoon/test/api");
-spoon.run();
-Factory factory = spoon.getFactory();
-// list all packages of the model
-for(CtPackage p : factory.Package().getAll()) {
- System.out.println("package: "+p.getQualifiedName());
-}
-// list all classes of the model
-for(CtType> s : factory.Class().getAll()) {
- System.out.println("class: "+s.getQualifiedName());
-}
-```
## Advanced
@@ -81,13 +65,3 @@ final String[] builder = new JDTBuilderImpl() //
.build();
```
-## What are references? How are they handled?
-
-Spoon analyzes source code. However, this source code may refer to libraries (as a field, parameter, or method return type). Those library may be or not in the classpath. The boundary between source and libraries is handled by the reference mechanism.
-
-When you're consider a reference object (say, a TypeReference), there are three cases:
-
-- Case 1: the reference points to a code element for which the source code is present. In this case, reference.getDeclaration() returns this code element (e.g. TypeReference.getDeclaration returns the CtType representing the given java file). reference.getTypeDeclaration() is identical to reference.getDeclaration().
-- Case 2: the reference points to a code element for which the source code is NOT present, but for which the binary class is in the classpath (either the JVM classpath or the --source-classpath argument). In this case, reference.getDeclaration() returns null and reference.getTypeDeclaration returns a partial CtType built using runtime reflection. Those objects built using runtime reflection are called shadow objects; and you can identify them with method isShadow. (This also holds for getFieldDeclaration and getExecutableDeclaration)
-- Case 3: : the reference points to a code element for which the source code is NOT present, but for which the binary class is NOT in the classpath. This is called in Spoon the noclasspath mode. In this case, both reference.getDeclaration() and reference.getTypeDeclaration() return null. (This also holds for getFieldDeclaration and getExecutableDeclaration)
-
diff --git a/doc/gradle.md b/doc/gradle.md
index c1a75f4810a..276036f4017 100644
--- a/doc/gradle.md
+++ b/doc/gradle.md
@@ -4,60 +4,6 @@ tags: [usage]
keywords: gradle, usage, java, plugin
---
-## Dependency
+The main documentation of the Spoon Gradle plugin is in the README of .
-```groovy
-compile 'fr.inria.gforge.spoon:spoon-core:{{site.spoon_release}}'
-```
-
-You may also have to add our repository, see below.
-
-
-## Plugin
-
-A Gradle plugin allows easily Spoon when using Gradle.
-This plugin isn't available in Maven Central yet. Clone the Git project
-on your computer and install it on your system. To do that, clone the
-official [GitHub project](https://github.com/SpoonLabs/spoon-gradle-plugin)
-of this plugin and launch the command line `./gradlew clean install` at
-the root directory of the plugin project. After that, use it in your
-`build.gradle` files of your project.
-
-
-```groovy
-buildscript {
- repositories {
- mavenLocal()
- maven {
- url 'http://spoon.gforge.inria.fr/repositories/'
- }
- }
- dependencies {
- classpath group: 'fr.inria.gforge.spoon',
- name: 'spoon-gradle-plugin',
- version:'1.0-SNAPSHOT'
- }
-}
-
-apply plugin: 'java'
-apply plugin: 'spoon'
-
-spoon {
- processors = ['fr.inria.gforge.spoon.processors.CatchProcessor']
-}
-```
-
-You simply specify your processors, in fully qualified name, in the configuration
-of the plugin, the processors will be applied on your target project before compilation.
-
-In short, the Gradle plugin gives the classpath of your project to Spoon,
-applies Spoon on all source directories and rewrites the transformed Java files in the build
-directory. These parameters can be changed in the configuration of the plugin.
-
-{{site.data.alerts.warning}}
-If you want use a processor which isn't in your target project, specify the dependency
-as classpath in the buildscript of your project where the Gradle plugin can retrieve it.
-Otherwise, your processor won't be applied.
-{{site.data.alerts.end}}
-
-To know more about this Gradle plugin, you can check the README of its [GitHub project](https://github.com/SpoonLabs/spoon-gradle-plugin).
+Pull requests on this documentation should be done on and not here.
diff --git a/doc/launcher.md b/doc/launcher.md
new file mode 100644
index 00000000000..2acd0a23efa
--- /dev/null
+++ b/doc/launcher.md
@@ -0,0 +1,87 @@
+---
+title: How to use Spoon in Java?
+tags: [usage]
+keywords: usage, java
+---
+
+## Basic Launcher
+
+The Spoon `Launcher` ([JavaDoc](http://spoon.gforge.inria.fr/mvnsites/spoon-core/apidocs/spoon/Launcher.html)) is used to create the AST model of a project.
+
+```java
+Launcher launcher = new Launcher();
+
+// path can be a folder or a file
+// addInputResource can be called several times
+launcher.addInputResource("");
+
+// if true, the pretty-printed code is readable without fully-qualified names
+launcher.getEnvironment().setAutoImports(true); // optional
+
+// if true, the model can be built even if the dependencies of the analyzed source code are not known or incomplete
+// the classes that are in the current classpath are taken into account
+launcher.getEnvironment().setNoClasspath(true); // optional
+
+launcher.buildModel();
+CtModel model = launcher.getModel();
+```
+
+
+## Maven Launcher
+
+The Spoon `MavenLauncher` ([JavaDoc](http://spoon.gforge.inria.fr/mvnsites/spoon-core/apidocs/spoon/MavenLauncher.html)) is used to create the AST model of a Maven project.
+It automatically infers the list of source folders and the dependencies from the `pom.xml` file.
+This Launcher handles multi-module Maven projects.
+
+```java
+// the second parameter can be APP_SOURCE / TEST_SOURCE / ALL_SOURCE
+MavenLauncher launcher = new MavenLauncher("", MavenLauncher.SOURCE_TYPE.APP_SOURCE);
+launcher.buildModel();
+CtModel model = launcher.getModel();
+
+// list all packages of the model
+for(CtPackage p : model.getAllPackages()) {
+ System.out.println("package: "+p.getQualifiedName());
+}
+// list all classes of the model
+for(CtType> s : model.getAllTypes()) {
+ System.out.println("class: "+s.getQualifiedName());
+}
+
+```
+
+
+
+## About the classpath
+
+
+Spoon analyzes source code. However, this source code may refer to libraries (as a field, parameter, or method return type). There are two cases:
+
+* Full classpath: all dependencies are in the JVM classpath or are given to the Laucher with `launcher.getEnvironment().setSourceClasspath("");` (optional)
+* No classpath: some dependencies are unknown and `launcher.getEnvironment().setNoClasspath(true)` is set.
+
+This has a direct impact on Spoon references.
+When you're consider a reference object (say, a TypeReference), there are three cases:
+
+- Case 1 (code available as source code): the reference points to a code element for which the source code is present. In this case, reference.getDeclaration() returns this code element (e.g. TypeReference.getDeclaration returns the CtType representing the given java file). reference.getTypeDeclaration() is identical to reference.getDeclaration().
+- Case 2 (code available as binary in the classpath): the reference points to a code element for which the source code is NOT present, but for which the binary class is in the classpath (either the JVM classpath or the --source-classpath argument). In this case, reference.getDeclaration() returns null and reference.getTypeDeclaration returns a partial CtType built using runtime reflection. Those objects built using runtime reflection are called shadow objects; and you can identify them with method isShadow. (This also holds for getFieldDeclaration and getExecutableDeclaration)
+- Case 3 (code not available, aka noclasspath): the reference points to a code element for which the source code is NOT present, but for which the binary class is NOT in the classpath. This is called in Spoon the noclasspath mode. In this case, both reference.getDeclaration() and reference.getTypeDeclaration() return null. (This also holds for getFieldDeclaration and getExecutableDeclaration)
+
+
+## Declaring the dependency to Spoon
+
+### Maven
+
+```xml
+
+ fr.inria.gforge.spoon
+ spoon-core
+ {{site.spoon_release}}
+
+```
+
+### Gradle
+
+```groovy
+compile 'fr.inria.gforge.spoon:spoon-core:{{site.spoon_release}}'
+```
diff --git a/doc/maven.md b/doc/maven.md
index b2a53d26e46..0f7d03f3f9f 100644
--- a/doc/maven.md
+++ b/doc/maven.md
@@ -4,83 +4,6 @@ tags: [usage]
keywords: maven, central, usage, java, plugin
---
-## Dependency
+The main documentation of the Spoon Maven plugin is in the README of .
-Stable version:
-
-```xml
-
- fr.inria.gforge.spoon
- spoon-core
- {{site.spoon_release}}
-
-```
-
-Snapshot version:
-
-```xml
-
-
- fr.inria.gforge.spoon
- spoon-core
- {{site.spoon_snapshot}}
-
-
-
-
- gforge.inria.fr-snapshot
- Maven Repository for Spoon Snapshot
- http://spoon.gforge.inria.fr/repositories/snapshots/
-
-
-
-```
-
-## Plugin
-
-A Maven plugin allows easily launching Spoon when using Maven. This plugin is available in Maven Central
-and can be directly inserted in a pom.xml file at the root of a project
-(or in the pom.xml of one of a maven module, where you want use Spoon).
-
-```xml
-
- fr.inria.gforge.spoon
- spoon-maven-plugin
- 2.5
-
-
- generate-sources
-
- generate
-
-
-
-
-
- fr.inria.gforge.spoon.processors.CatchProcessor
-
-
-
-
-
- fr.inria.gforge.spoon
- spoon-core
- {{site.spoon_release}}
-
-
-
-```
-
-You simply specify your processors, in fully qualified name, in the configuration
-of the plugin, the processors will be applied on your target project before compilation.
-
-In short, the Maven plugin gives the classpath of your project to Spoon,
-applies Spoon on all source directories and rewrites the transformed Java files in the target
-directory. These parameters can be changed in the configuration of the plugin.
-
-{{site.data.alerts.warning}}
-If you want use a processor which isn't in your project, specify the dependency
-where the Maven plugin can retrieve it. Otherwise, your processor won't be applied.
-{{site.data.alerts.end}}
-
-To know more about this Maven plugin, check the README of its [GitHub project](https://github.com/SpoonLabs/spoon-maven-plugin).
+Pull requests on this documentation should be done on and not here.
diff --git a/pom.xml b/pom.xml
index 2cb92bcabda..46a07418626 100644
--- a/pom.xml
+++ b/pom.xml
@@ -246,6 +246,11 @@
commons-io
2.5
+
+ org.apache.maven
+ maven-model
+ 3.5.0
+
org.apache.commons
commons-lang3
diff --git a/src/main/java/spoon/MavenLauncher.java b/src/main/java/spoon/MavenLauncher.java
new file mode 100644
index 00000000000..aba83047db3
--- /dev/null
+++ b/src/main/java/spoon/MavenLauncher.java
@@ -0,0 +1,391 @@
+/**
+ * Copyright (C) 2006-2017 INRIA and contributors
+ * Spoon - http://spoon.gforge.inria.fr/
+ *
+ * This software is governed by the CeCILL-C License under French law and
+ * abiding by the rules of distribution of free software. You can use, modify
+ * and/or redistribute the software under the terms of the CeCILL-C license as
+ * circulated by CEA, CNRS and INRIA at http://www.cecill.info.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details.
+ *
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL-C license and that you accept its terms.
+ */
+package spoon;
+
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Create a Spoon launcher from a maven pom file
+ */
+public class MavenLauncher extends Launcher {
+ private String m2RepositoryPath;
+ private SOURCE_TYPE sourceType;
+
+ /**
+ * The type of source to consider in the model
+ */
+ public enum SOURCE_TYPE {
+ // only the main code of the application
+ APP_SOURCE,
+ // only the tests of the application
+ TEST_SOURCE,
+ // all the sources
+ ALL_SOURCE
+ }
+
+ public MavenLauncher(String mavenProject, SOURCE_TYPE sourceType) {
+ this(mavenProject, Paths.get(System.getProperty("user.home"), ".m2", "repository").toString(), sourceType);
+ }
+
+ /**
+ *
+ * @param mavenProject the path to the root of the project
+ * @param m2RepositoryPath the path to the m2repository
+ */
+ public MavenLauncher(String mavenProject, String m2RepositoryPath, SOURCE_TYPE sourceType) {
+ super();
+ this.m2RepositoryPath = m2RepositoryPath;
+ this.sourceType = sourceType;
+
+ File mavenProjectFile = new File(mavenProject);
+ if (!mavenProjectFile.exists()) {
+ throw new SpoonException(mavenProject + " does not exist.");
+ }
+
+ InheritanceModel model;
+ try {
+ model = readPOM(mavenProject, null);
+ } catch (Exception e) {
+ throw new SpoonException("Unable to read the pom", e);
+ }
+ if (model == null) {
+ throw new SpoonException("Unable to create the model, pom not found?");
+ }
+
+ // app source
+ if (SOURCE_TYPE.APP_SOURCE == sourceType || SOURCE_TYPE.ALL_SOURCE == sourceType) {
+ List sourceDirectories = model.getSourceDirectories();
+ for (File sourceDirectory : sourceDirectories) {
+ this.addInputResource(sourceDirectory.getAbsolutePath());
+ }
+ }
+
+ // test source
+ if (SOURCE_TYPE.TEST_SOURCE == sourceType || SOURCE_TYPE.ALL_SOURCE == sourceType) {
+ List testSourceDirectories = model.getTestDirectories();
+ for (File sourceDirectory : testSourceDirectories) {
+ this.addInputResource(sourceDirectory.getAbsolutePath());
+ }
+ }
+
+ // dependencies
+ List dependencies = model.getDependencies(false);
+ String[] classpath = new String[dependencies.size()];
+ for (int i = 0; i < dependencies.size(); i++) {
+ File file = dependencies.get(i);
+ classpath[i] = file.getAbsolutePath();
+ }
+ this.getModelBuilder().setSourceClasspath(classpath);
+
+ // compliance level
+ this.getEnvironment().setComplianceLevel(model.getSourceVersion());
+ }
+
+ /**
+ * Extract the information from the pom
+ * @param path the path to the pom
+ * @param parent the parent pom
+ * @return the extracted model
+ * @throws IOException when the file does not exist
+ * @throws XmlPullParserException when the file is corrupted
+ */
+ private InheritanceModel readPOM(String path, InheritanceModel parent) throws IOException, XmlPullParserException {
+ if (!path.endsWith(".xml") && !path.endsWith(".pom")) {
+ path = Paths.get(path, "pom.xml").toString();
+ }
+ File pomFile = new File(path);
+ if (!pomFile.exists()) {
+ return null;
+ }
+ MavenXpp3Reader pomReader = new MavenXpp3Reader();
+ try (FileReader reader = new FileReader(pomFile)) {
+ Model model = pomReader.read(reader);
+ InheritanceModel inheritanceModel = new InheritanceModel(model, parent, pomFile.getParentFile());
+ for (String module : model.getModules()) {
+ inheritanceModel.addModule(readPOM(Paths.get(pomFile.getParent(), module).toString(), inheritanceModel));
+ }
+ return inheritanceModel;
+ }
+ }
+
+ class InheritanceModel {
+ private List modules = new ArrayList<>();
+ private Model model;
+ private InheritanceModel parent;
+ private File directory;
+
+ InheritanceModel(Model model, InheritanceModel parent, File directory) {
+ this.model = model;
+ this.parent = parent;
+ this.directory = directory;
+ }
+
+ public void addModule(InheritanceModel module) {
+ modules.add(module);
+ }
+
+ public Model getModel() {
+ return model;
+ }
+
+ /**
+ * Get the parent model
+ * @return the parent model
+ */
+ public InheritanceModel getParent() {
+ return parent;
+ }
+
+ /**
+ * Get the list of source directories of the project
+ * @return the list of source directories
+ */
+ public List getSourceDirectories() {
+ List output = new ArrayList<>();
+ String sourcePath = null;
+
+ Build build = model.getBuild();
+ if (build != null) {
+ sourcePath = build.getSourceDirectory();
+ }
+ if (sourcePath == null) {
+ sourcePath = Paths.get(directory.getAbsolutePath(), "src", "main", "java").toString();
+ }
+ File source = new File(sourcePath);
+ if (source.exists()) {
+ output.add(source);
+ }
+ File generatedSource = Paths.get(directory.getAbsolutePath(), "target", "generated-sources").toFile();
+ if (generatedSource.exists()) {
+ output.add(generatedSource);
+ }
+ for (InheritanceModel module : modules) {
+ output.addAll(module.getSourceDirectories());
+ }
+ return output;
+ }
+
+ /**
+ * Get the list of test directories of the project
+ * @return the list of test directories
+ */
+ public List getTestDirectories() {
+ List output = new ArrayList<>();
+ String sourcePath = null;
+
+ Build build = model.getBuild();
+ if (build != null) {
+ sourcePath = build.getTestSourceDirectory();
+ }
+ if (sourcePath == null) {
+ sourcePath = Paths.get(directory.getAbsolutePath(), "src", "test", "java").toString();
+ }
+ File source = new File(sourcePath);
+ if (source.exists()) {
+ output.add(source);
+ }
+ File generatedSource = Paths.get(directory.getAbsolutePath(), "target", "generated-test-sources").toFile();
+ if (generatedSource.exists()) {
+ output.add(generatedSource);
+ }
+ for (InheritanceModel module : modules) {
+ output.addAll(module.getTestDirectories());
+ }
+ return output;
+ }
+
+ /**
+ * Extract the variable from a string
+ */
+ private String extractVariable(String value) {
+ if (value.startsWith("$")) {
+ value = getProperty(value.substring(2, value.length() - 1));
+ }
+ return value;
+ }
+
+ /**
+ * Get the list of dependencies available in the local maven repository
+ * @return the list of dependencies
+ */
+ public List getDependencies(boolean isLib) {
+ Set output = new HashSet<>();
+
+ // add the parent has a dependency
+ Parent parent = model.getParent();
+ if (parent != null) {
+ String groupId = parent.getGroupId().replace(".", "/");
+ String version = extractVariable(parent.getVersion());
+ if (version.startsWith("[")) {
+ version = version.substring(1, version.indexOf(','));
+ }
+ String fileName = parent.getArtifactId() + "-" + version + ".jar";
+ Path depPath = Paths.get(m2RepositoryPath, groupId, parent.getArtifactId(), version, fileName);
+ File jar = depPath.toFile();
+ if (jar.exists()) {
+ output.add(jar);
+ }
+ }
+ List dependencies = model.getDependencies();
+ for (Dependency dependency : dependencies) {
+ String groupId = dependency.getGroupId().replace(".", "/");
+ if (dependency.getVersion() == null) {
+ continue;
+ }
+ // TODO: Handle range version
+ String version = extractVariable(dependency.getVersion());
+ if (version.startsWith("[")) {
+ version = version.substring(1, version.indexOf(','));
+ }
+ if (dependency.isOptional()) {
+ continue;
+ }
+ // ignore test dependencies for app source code
+ if ("test".equals(dependency.getScope()) && SOURCE_TYPE.APP_SOURCE == sourceType) {
+ continue;
+ }
+ // ignore not transitive dependencies
+ if (isLib && ("test".equals(dependency.getScope()) || "provided".equals(dependency.getScope()))) {
+ continue;
+ }
+ String fileName = dependency.getArtifactId() + "-" + version;
+ // TODO: Check the scope of the dependency (local dependency is not handled)
+ Path depPath = Paths.get(m2RepositoryPath, groupId, dependency.getArtifactId(), version);
+ File depFile = depPath.toFile();
+ if (depFile.exists()) {
+ File jarFile = Paths.get(depPath.toString(), fileName + ".jar").toFile();
+ if (jarFile.exists()) {
+ output.add(jarFile);
+ } else {
+ // if the a dependency is not found, uses the no classpath mode
+ getEnvironment().setNoClasspath(true);
+ }
+
+ try {
+ InheritanceModel dependencyModel = readPOM(Paths.get(depPath.toString(), fileName + ".pom").toString(), null);
+ output.addAll(dependencyModel.getDependencies(true));
+ } catch (Exception ignore) {
+ // ignore the dependencies of the dependency
+ }
+ } else {
+ // if the a dependency is not found, uses the no classpath mode
+ getEnvironment().setNoClasspath(true);
+ }
+ }
+
+ for (InheritanceModel module : modules) {
+ output.addAll(module.getDependencies(isLib));
+ }
+ return new ArrayList<>(output);
+ }
+
+ /**
+ * Get the value of a property
+ * @param key the key of the property
+ * @return the property value if key exists or null
+ */
+ private String getProperty(String key) {
+ if ("project.version".equals(key)) {
+ if (model.getVersion() != null) {
+ return model.getVersion();
+ }
+ }
+ String value = model.getProperties().getProperty(key);
+ if (value == null) {
+ if (parent == null) {
+ return null;
+ }
+ return parent.getProperty(key);
+ }
+ return value;
+ }
+
+ /**
+ * Get the source version of the project
+ * @return the source version of the project
+ */
+ public int getSourceVersion() {
+ for (Plugin plugin : model.getBuild().getPlugins()) {
+ if (!"maven-compiler-plugin".equals(plugin.getArtifactId())) {
+ continue;
+ }
+ Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
+ Xpp3Dom source = configuration.getChild("source");
+ if (source != null) {
+ return Integer.parseInt(extractVariable(source.getValue()).substring(2));
+ }
+ break;
+ }
+ String javaVersion = getProperty("java.version");
+ if (javaVersion != null) {
+ return Integer.parseInt(extractVariable(javaVersion).substring(2));
+ }
+ javaVersion = getProperty("java.src.version");
+ if (javaVersion != null) {
+ return Integer.parseInt(extractVariable(javaVersion).substring(2));
+ }
+ javaVersion = getProperty("maven.compiler.source");
+ if (javaVersion != null) {
+ return Integer.parseInt(extractVariable(javaVersion).substring(2));
+ }
+ javaVersion = getProperty("maven.compile.source");
+ if (javaVersion != null) {
+ return Integer.parseInt(extractVariable(javaVersion).substring(2));
+ }
+ // return the current compliance level of spoon
+ return getEnvironment().getComplianceLevel();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(model.getName());
+ if (modules.isEmpty()) {
+ return sb.toString();
+ }
+ sb.append(" {\n");
+ for (int i = 0; i < modules.size(); i++) {
+ InheritanceModel inheritanceModel = modules.get(i);
+ String child = inheritanceModel.toString();
+ for (String s : child.split("\n")) {
+ sb.append("\t");
+ sb.append(s);
+ sb.append("\n");
+ }
+ }
+ sb.append("}");
+ return sb.toString();
+ }
+ }
+}
diff --git a/src/test/java/spoon/MavenLauncherTest.java b/src/test/java/spoon/MavenLauncherTest.java
new file mode 100644
index 00000000000..4c61cdc10fe
--- /dev/null
+++ b/src/test/java/spoon/MavenLauncherTest.java
@@ -0,0 +1,45 @@
+package spoon;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class MavenLauncherTest {
+ @Test
+ public void spoonMavenLauncherTest() {
+ // without the tests
+ MavenLauncher launcher = new MavenLauncher("./", MavenLauncher.SOURCE_TYPE.APP_SOURCE);
+
+ assertEquals(8, launcher.getEnvironment().getComplianceLevel());
+
+ assertEquals(6, launcher.getEnvironment().getSourceClasspath().length);
+ // 54 because of the sub folders of src/main/java
+ assertEquals(54, launcher.getModelBuilder().getInputSources().size());
+
+ // with the tests
+ launcher = new MavenLauncher("./", MavenLauncher.SOURCE_TYPE.ALL_SOURCE);
+ // 235 because of the sub folders of src/main/java and src/test/java
+ assertEquals(235, launcher.getModelBuilder().getInputSources().size());
+
+ // specify the pom.xml
+ launcher = new MavenLauncher("./pom.xml", MavenLauncher.SOURCE_TYPE.APP_SOURCE);
+ assertEquals(8, launcher.getEnvironment().getComplianceLevel());
+ }
+
+ @Test
+ public void multiModulesProjectTest() {
+ MavenLauncher launcher = new MavenLauncher("./src/test/resources/maven-launcher/pac4j", MavenLauncher.SOURCE_TYPE.ALL_SOURCE);
+ assertEquals(8, launcher.getEnvironment().getComplianceLevel());
+ assertEquals(0, launcher.getModelBuilder().getInputSources().size());
+ }
+
+ @Test(expected = SpoonException.class)
+ public void mavenLauncherOnANotExistingFileTest() {
+ new MavenLauncher("./pomm.xml", MavenLauncher.SOURCE_TYPE.APP_SOURCE);
+ }
+
+ @Test(expected = SpoonException.class)
+ public void mavenLauncherOnDirectoryWithoutPomTest() {
+ new MavenLauncher("./src", MavenLauncher.SOURCE_TYPE.APP_SOURCE);
+ }
+}
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-cas/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-cas/pom.xml
new file mode 100644
index 00000000000..171b8e5e51f
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-cas/pom.xml
@@ -0,0 +1,79 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-cas
+ jar
+ pac4j for CAS protocol
+
+
+ 3.4.1
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.jasig.cas.client
+ cas-client-core
+ ${cas.version}
+
+
+ org.jasig.cas.client
+ cas-client-support-saml
+ ${cas.version}
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+ com.google.guava
+ guava
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.cas
+ org.pac4j.cas.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-config/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-config/pom.xml
new file mode 100644
index 00000000000..31c0ab0af3b
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-config/pom.xml
@@ -0,0 +1,129 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-config
+ jar
+ pac4j configuration
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.pac4j
+ pac4j-cas
+ true
+
+
+ org.pac4j
+ pac4j-saml
+ true
+
+
+ org.pac4j
+ pac4j-oauth
+ true
+
+
+ org.pac4j
+ pac4j-oidc
+ true
+
+
+ org.pac4j
+ pac4j-ldap
+ true
+
+
+ org.pac4j
+ pac4j-http
+ true
+
+
+ com.zaxxer
+ HikariCP
+ 2.6.1
+
+
+ org.pac4j
+ pac4j-sql
+ true
+
+
+ org.springframework.security
+ spring-security-crypto
+ true
+
+
+ org.apache.shiro
+ shiro-core
+ true
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.pac4j
+ pac4j-ldap
+ test-jar
+ test
+
+
+ com.unboundid
+ unboundid-ldapsdk
+ test
+
+
+ org.pac4j
+ pac4j-sql
+ test-jar
+ test
+
+
+ com.h2database
+ h2
+ ${h2.version}
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.config
+ org.pac4j.config.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-core/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-core/pom.xml
new file mode 100644
index 00000000000..100ecb87171
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-core/pom.xml
@@ -0,0 +1,122 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-core
+ jar
+ pac4j core
+
+
+ org.slf4j
+ slf4j-api
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+ com.google.guava
+ guava
+ true
+
+
+ org.springframework.security
+ spring-security-crypto
+ true
+
+
+ org.apache.shiro
+ shiro-core
+ true
+
+
+
+ junit
+ junit
+ test
+
+
+ org.springframework
+ spring-test
+ test
+
+
+ org.slf4j
+ jcl-over-slf4j
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.mockito
+ mockito-core
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.core
+ org.pac4j.core.*;version=${project.version}
+ *
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-couch/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-couch/pom.xml
new file mode 100644
index 00000000000..a92ba47e29e
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-couch/pom.xml
@@ -0,0 +1,81 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-couch
+ jar
+ pac4j for CouchDB
+
+
+ 1.4.4
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.ektorp
+ org.ektorp
+ ${ektorp.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.3.3
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ io.bdrc
+ mcouch-ektorp
+ 1.0.0
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.apache.shiro
+ shiro-core
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.couch
+ org.pac4j.couch.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-gae/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-gae/pom.xml
new file mode 100644
index 00000000000..ad0ba660e55
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-gae/pom.xml
@@ -0,0 +1,99 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-gae
+ jar
+ pac4j for GAE UserService mechanism
+
+
+ 1.9.50
+ 1.1
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ com.google.appengine
+ appengine-api-1.0-sdk
+ ${gae.version}
+
+
+ com.google.appengine
+ appengine-jsr107cache
+ ${gae.version}
+
+
+ net.sf.jsr107cache
+ jsr107cache
+ ${jsr107cache.version}
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ com.google.appengine
+ appengine-testing
+ ${gae.version}
+ test
+
+
+ com.google.appengine
+ appengine-api-labs
+ ${gae.version}
+ test
+
+
+ com.google.appengine
+ appengine-api-stubs
+ ${gae.version}
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.gae
+ org.pac4j.gae.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-http/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-http/pom.xml
new file mode 100644
index 00000000000..c7b9fc54cef
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-http/pom.xml
@@ -0,0 +1,123 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-http
+ jar
+ pac4j for HTTP protocol
+
+
+ 2.3.1
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ commons-codec
+ commons-codec
+ true
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.mockito
+ mockito-core
+ test
+
+
+ com.google.guava
+ guava
+ test
+
+
+ org.nanohttpd
+ nanohttpd
+ ${nanohttpd.version}
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.http
+ org.pac4j.http.*;version=${project.version}
+ *
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-jwt/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-jwt/pom.xml
new file mode 100644
index 00000000000..286f4484d2a
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-jwt/pom.xml
@@ -0,0 +1,74 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-jwt
+ jar
+ pac4j for JWT
+
+
+ 1.56
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ com.nimbusds
+ nimbus-jose-jwt
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+ ${bcprov.version}
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.pac4j
+ pac4j-oauth
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.jwt
+ org.pac4j.jwt.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-kerberos/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-kerberos/pom.xml
new file mode 100644
index 00000000000..a9249bc8ae5
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-kerberos/pom.xml
@@ -0,0 +1,109 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-kerberos
+ jar
+ pac4j for Kerberos
+
+
+ 1.0.0
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+
+ org.springframework
+ spring-core
+ ${spring.version}
+
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.mockito
+ mockito-core
+ test
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+
+ org.apache.kerby
+ kerby-kdc
+ ${kerby.version}
+ test
+
+
+ org.apache.kerby
+ kerb-simplekdc
+ ${kerby.version}
+ test
+
+
+ org.apache.kerby
+ kerb-client
+ ${kerby.version}
+ test
+
+
+ org.apache.kerby
+ token-provider
+ ${kerby.version}
+ test
+
+
+ org.apache.kerby
+ integration-test
+ ${kerby.version}
+ test
+
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.kerberos
+ org.pac4j.kerberos.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-ldap/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-ldap/pom.xml
new file mode 100644
index 00000000000..48519f201eb
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-ldap/pom.xml
@@ -0,0 +1,108 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-ldap
+ jar
+ pac4j for LDAP
+
+
+ 1.2.1
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.ldaptive
+ ldaptive
+ ${ldaptive.version}
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ com.unboundid
+ unboundid-ldapsdk
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.ldap
+ org.pac4j.ldap.*;version=${project.version}
+ *
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-mongo/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-mongo/pom.xml
new file mode 100644
index 00000000000..4d0beae60b4
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-mongo/pom.xml
@@ -0,0 +1,115 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-mongo
+ jar
+ pac4j for MongoDB
+
+
+ 3.4.2
+ 2.0.0
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.mongodb
+ mongo-java-driver
+ ${mongo-driver.version}
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.apache.shiro
+ shiro-core
+ test
+
+
+ de.flapdoodle.embed
+ de.flapdoodle.embed.mongo
+ ${flapdoodle.version}
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.mongo
+ org.pac4j.mongo.*;version=${project.version}
+ *
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-oauth/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-oauth/pom.xml
new file mode 100644
index 00000000000..41b39e42a13
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-oauth/pom.xml
@@ -0,0 +1,78 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-oauth
+ jar
+ pac4j for OAuth protocol
+
+
+ 3.3.0
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ commons-codec
+ commons-codec
+
+
+ com.github.scribejava
+ scribejava-apis
+ ${scribe.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.oauth
+ org.pac4j.oauth.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-oidc/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-oidc/pom.xml
new file mode 100644
index 00000000000..bde81cf376d
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-oidc/pom.xml
@@ -0,0 +1,75 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-oidc
+ jar
+ pac4j for OpenID Connect protocol
+
+
+ 5.24.2
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ com.nimbusds
+ oauth2-oidc-sdk
+ ${oauth-oidc-sdk.version}
+
+
+ com.nimbusds
+ nimbus-jose-jwt
+
+
+
+
+ com.nimbusds
+ nimbus-jose-jwt
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.oidc
+ org.pac4j.oidc.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-openid/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-openid/pom.xml
new file mode 100644
index 00000000000..f25f9de3afd
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-openid/pom.xml
@@ -0,0 +1,86 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-openid
+ jar
+ pac4j for OpenId protocol
+
+
+ 1.0.0
+ 2.0.2
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.openid4java
+ openid4java
+ ${openid4java.version}
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+ org.slf4j
+ jcl-over-slf4j
+
+
+ xml-apis
+ xml-apis
+ ${xml-apis.version}
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.openid
+ org.pac4j.openid.*;version=${project.version}
+ *
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-saml/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-saml/pom.xml
new file mode 100644
index 00000000000..8e0102a3687
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-saml/pom.xml
@@ -0,0 +1,222 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-saml
+ jar
+ pac4j for SAML protocol
+
+
+ 3.3.0
+ 2.9.2
+ 1.7
+
+ 3.2.2
+ 1.1.0
+ 2.7.2
+ 7.3.0
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.opensaml
+ opensaml-core
+ ${opensaml.version}
+ compile
+
+
+ net.shibboleth.utilities
+ java-support
+ ${java-support.version}
+ compile
+
+
+ org.opensaml
+ opensaml-saml-api
+ ${opensaml.version}
+ compile
+
+
+ org.opensaml
+ opensaml-saml-impl
+ ${opensaml.version}
+ compile
+
+
+ org.opensaml
+ opensaml-soap-api
+ ${opensaml.version}
+ compile
+
+
+ org.opensaml
+ opensaml-xmlsec-api
+ ${opensaml.version}
+
+
+ org.opensaml
+ opensaml-security-api
+ ${opensaml.version}
+
+
+ org.opensaml
+ opensaml-security-impl
+ ${opensaml.version}
+
+
+ org.opensaml
+ opensaml-profile-api
+ ${opensaml.version}
+
+
+ org.opensaml
+ opensaml-profile-impl
+ ${opensaml.version}
+
+
+ org.opensaml
+ opensaml-messaging-api
+ ${opensaml.version}
+
+
+ org.opensaml
+ opensaml-messaging-impl
+ ${opensaml.version}
+
+
+ org.opensaml
+ opensaml-xmlsec-impl
+ ${opensaml.version}
+
+
+ com.google.guava
+ guava
+
+
+ org.cryptacular
+ cryptacular
+ ${cryptacular.version}
+
+
+ bcprov-jdk15on
+ org.bouncycastle
+
+
+
+
+ joda-time
+ joda-time
+ ${joda-time.version}
+
+
+ xalan
+ xalan
+ ${xalan.version}
+
+
+ org.apache.velocity
+ velocity
+ ${velocity.version}
+
+
+ commons-collections
+ commons-collections
+ ${commons-collections.version}
+
+
+ org.slf4j
+ jcl-over-slf4j
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+ org.springframework
+ spring-core
+ compile
+ ${spring.version}
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ ch.qos.logback
+ logback-classic
+ test
+
+
+ org.springframework
+ spring-test
+ test
+
+
+ org.springframework
+ spring-web
+ ${spring.version}
+ test
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+ org.mockito
+ mockito-core
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.saml2
+ org.pac4j.saml.*;version=${project.version}
+ org.joda.time;version="[1.6,3)",*
+
+
+
+
+
+
+
+
+ shib-release
+ https://build.shibboleth.net/nexus/content/groups/public
+
+ false
+
+
+ true
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pac4j-sql/pom.xml b/src/test/resources/maven-launcher/pac4j/pac4j-sql/pom.xml
new file mode 100644
index 00000000000..780e552a935
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pac4j-sql/pom.xml
@@ -0,0 +1,109 @@
+
+
+ 4.0.0
+
+
+ org.pac4j
+ pac4j
+ 3.0.0-SNAPSHOT
+
+
+ pac4j-sql
+ jar
+ pac4j for relational DB
+
+
+ 2.78
+
+
+
+
+ org.pac4j
+ pac4j-core
+
+
+ org.jdbi
+ jdbi
+ ${jdbi.version}
+
+
+
+ org.pac4j
+ pac4j-core
+ test-jar
+ test
+
+
+ junit
+ junit
+ test
+
+
+ org.springframework.security
+ spring-security-crypto
+ test
+
+
+ com.h2database
+ h2
+ ${h2.version}
+ test
+
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.pac4j.sql
+ org.pac4j.sql.*;version=${project.version}
+ *
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+ test-jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
diff --git a/src/test/resources/maven-launcher/pac4j/pom.xml b/src/test/resources/maven-launcher/pac4j/pom.xml
new file mode 100644
index 00000000000..2425b9e7f2a
--- /dev/null
+++ b/src/test/resources/maven-launcher/pac4j/pom.xml
@@ -0,0 +1,507 @@
+
+
+ 4.0.0
+
+
+ org.sonatype.oss
+ oss-parent
+ 9
+
+
+ org.pac4j
+ pac4j
+ pom
+ pac4j
+ 3.0.0-SNAPSHOT
+ Profile & Authentication Client for Java
+ https://github.com/pac4j/pac4j
+
+
+
+ The Apache Software License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+
+ https://github.com/pac4j/pac4j.git
+ scm:git:git@github.com:pac4j/pac4j.git
+ scm:git:git@github.com:pac4j/pac4j.git
+
+
+
+
+ leleuj
+ Jerome LELEU
+ leleuj@gmail.com
+
+
+
+
+ pac4j-core
+ pac4j-config
+ pac4j-oauth
+ pac4j-cas
+ pac4j-openid
+ pac4j-http
+ pac4j-saml
+ pac4j-gae
+ pac4j-oidc
+ pac4j-jwt
+ pac4j-ldap
+ pac4j-sql
+ pac4j-mongo
+ pac4j-couch
+ pac4j-kerberos
+
+
+
+ 4.12
+ 3.1.0
+ 1.2.2
+ 1.10
+ 21.0
+ 4.35
+ 4.3.7.RELEASE
+ 4.2.2.RELEASE
+ 1.3.2
+ 2.7.19
+ 1.7.25
+ 3.2.1
+ 1.4.194
+ 1.8
+ 2.8.7
+ UTF-8
+ UTF-8
+
+
+
+
+
+ org.pac4j
+ pac4j-core
+ ${project.version}
+
+
+ org.pac4j
+ pac4j-oauth
+ ${project.version}
+
+
+ org.pac4j
+ pac4j-cas
+ ${project.version}
+
+
+ org.pac4j
+ pac4j-saml
+ ${project.version}
+
+
+ org.pac4j
+ pac4j-oidc
+ ${project.version}
+
+
+ org.pac4j
+ pac4j-ldap
+ ${project.version}
+
+
+ org.pac4j
+ pac4j-http
+ ${project.version}
+
+
+ org.pac4j
+ pac4j-sql
+ ${project.version}
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4j.version}
+
+
+ org.springframework.security
+ spring-security-crypto
+ ${spring.security.version}
+
+
+ org.apache.shiro
+ shiro-core
+ ${shiro.version}
+
+
+ commons-codec
+ commons-codec
+ ${commons-codec.version}
+
+
+ javax.servlet
+ javax.servlet-api
+ ${servlet-api.version}
+
+
+ com.google.guava
+ guava
+ ${guava.version}
+
+
+ com.nimbusds
+ nimbus-jose-jwt
+ ${nimbus-jose-jwt.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
+
+
+ org.pac4j
+ pac4j-core
+ ${project.version}
+ test-jar
+
+
+ org.pac4j
+ pac4j-ldap
+ ${project.version}
+ test-jar
+
+
+ org.pac4j
+ pac4j-sql
+ ${project.version}
+ test-jar
+
+
+ junit
+ junit
+ ${junit.version}
+
+
+ org.springframework
+ spring-test
+ ${spring.version}
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+ org.slf4j
+ jcl-over-slf4j
+ ${slf4j.version}
+
+
+ ch.qos.logback
+ logback-classic
+ ${logback.version}
+
+
+ org.mockito
+ mockito-core
+ ${mockito.version}
+
+
+ com.unboundid
+ unboundid-ldapsdk
+ ${unboundid.version}
+
+
+ com.h2database
+ h2
+ ${h2.version}
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 2.3
+
+
+ package
+
+ shade
+
+
+
+ ${project.artifactId}-${project.version}-all.jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.19.1
+
+
+ **/*Tests.java
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 2.17
+
+ checkstyle.xml
+
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+ 2.6
+
+
+
+ integration-test
+ verify
+
+
+
+
+ true
+
+ **/*IT.java
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.5
+
+
+ ${java.version}
+ UTF-8
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ regex-property
+
+ regex-property
+
+
+ module.suffix
+ ${project.artifactId}
+ ^(pac4j\-)(.*)$
+ $2
+ false
+
+
+
+ set-osgi-version
+ verify
+
+ parse-version
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+ verify
+
+ jar
+
+
+
+
+
+
+ 2
+ ${project.name}
+ ${project.groupId}.${module.suffix}.source
+ ${organization.name}
+ ${parsedVersion.osgiVersion}
+ ${project.groupId}.${module.suffix};version="${parsedVersion.osgiVersion}";roots:="."
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.codehaus.mojo
+ findbugs-maven-plugin
+ 3.0.3
+
+ Low
+ Max
+ true
+ ${basedir}/../findbugs-exclude.xml
+ true
+
+
+
+ run-findbugs
+ compile
+
+ check
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+ 3.6
+
+ true
+ true
+
+
+
+ run-pmd
+ compile
+
+ check
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.6
+
+
+
+
+ ${project.build.outputDirectory}/META-INF/MANIFEST.MF
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.10.3
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.7
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.4
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ 3.0.1
+ true
+
+
+ bundle-manifest
+ process-classes
+
+ manifest
+
+
+
+
+
+
+ jar
+
+
+
+
+
+
+
+
+
+ release-sign-artifacts
+
+
+ performRelease
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.6
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+ forceIT
+
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+ 2.6
+
+
+
+ integration-test
+ verify
+
+
+
+
+ false
+
+ **/*IT.java
+
+
+
+
+
+
+
+
+