1
2
3
4
5 package com.qulice.maven;
6
7 import java.io.File;
8 import org.apache.maven.model.Build;
9 import org.apache.maven.project.MavenProject;
10
11
12
13
14
15 public final class MavenProjectMocker {
16
17
18
19
20 private final MavenProject project = new MavenProject();
21
22
23
24
25
26
27 public MavenProjectMocker inBasedir(final File dir) {
28 final File parent = new File(dir, "target");
29 final Build build = new Build();
30 build.setOutputDirectory(parent.getPath());
31 this.project.setFile(parent);
32 this.project.setBuild(build);
33 return this;
34 }
35
36
37
38
39
40
41 public MavenProject mock() throws Exception {
42 this.project.setPackaging("jar");
43 return this.project;
44 }
45 }