Skip to content

Commit bca6f3d

Browse files
committed
Prepare deployment to maven central: Fixing javadoc, adapt pom.
1 parent 70a6621 commit bca6f3d

File tree

5 files changed

+328
-224
lines changed

5 files changed

+328
-224
lines changed

swan_core/pom.xml

Lines changed: 120 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,60 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0"
22
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
54
<modelVersion>4.0.0</modelVersion>
65

76
<groupId>de.upb.cs.swt</groupId>
87
<artifactId>swan_core</artifactId>
98
<packaging>jar</packaging>
10-
<version>1.0.0-SNAPSHOT</version>
9+
<version>1.0.0</version>
1110

1211
<name>SWAN Weakness Detector</name>
12+
<description>SWAN is a machine-learning approach for detection of methods of interest for security in Java libraries.</description>
13+
<url>https://github.com/secure-software-engineering/swan</url>
14+
15+
<licenses>
16+
<license>
17+
<name>BSD 3-Clause License</name>
18+
<url>https://opensource.org/licenses/BSD-3-Clause</url>
19+
<distribution>repo</distribution>
20+
</license>
21+
</licenses>
22+
23+
<developers>
24+
<developer>
25+
<id>piskachev</id>
26+
<name>Goran Piskachev</name>
27+
<email>goran.piskachev@iem.fraunhofer.de</email>
28+
</developer>
29+
<developer>
30+
<id>nguyen</id>
31+
<name>Lisa Nguyen</name>
32+
<email>lisa.nguyen@uni-paderborn.de</email>
33+
</developer>
34+
<developer>
35+
<id>johnson</id>
36+
<name>Oshando Johnson</name>
37+
<email>oshando@iem.fraunhofer.de</email>
38+
</developer>
39+
<developer>
40+
<id>budde</id>
41+
<name>Ingo Budde</name>
42+
<email>ingo.budde@iem.fraunhofer.de</email>
43+
</developer>
44+
<developer>
45+
<id>bodden</id>
46+
<name>Eric Bodden</name>
47+
<email>eric.bodden@uni-paderborn.de</email>
48+
</developer>
49+
50+
</developers>
51+
52+
<scm>
53+
<connection>scm:git:https://github.com/secure-software-engineering/swan.git</connection>
54+
<developerConnection>scm:git:ssh://github.com/secure-software-engineering/swan.git</developerConnection>
55+
<url>https://github.com/secure-software-engineering/swan</url>
56+
<tag>HEAD</tag>
57+
</scm>
1358

1459
<dependencies>
1560
<dependency>
@@ -29,6 +74,17 @@
2974
</dependency>
3075
</dependencies>
3176

77+
<distributionManagement>
78+
<snapshotRepository>
79+
<id>ossrh</id>
80+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
81+
</snapshotRepository>
82+
<repository>
83+
<id>ossrh</id>
84+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
85+
</repository>
86+
</distributionManagement>
87+
3288
<repositories>
3389
<repository>
3490
<id>soot-snapshot</id>
@@ -109,4 +165,66 @@
109165
</plugin>
110166
</plugins>
111167
</build>
168+
169+
<!-- release build command: mvn clean install -Prelease -->
170+
<profiles>
171+
<profile>
172+
<id>release</id>
173+
<build>
174+
<plugins>
175+
<plugin>
176+
<groupId>org.apache.maven.plugins</groupId>
177+
<artifactId>maven-javadoc-plugin</artifactId>
178+
<version>3.0.0</version>
179+
<executions>
180+
<execution>
181+
<id>attach-javadocs</id>
182+
<goals>
183+
<goal>jar</goal>
184+
</goals>
185+
</execution>
186+
</executions>
187+
</plugin>
188+
<plugin>
189+
<groupId>org.apache.maven.plugins</groupId>
190+
<artifactId>maven-source-plugin</artifactId>
191+
<version>3.0.1</version>
192+
<executions>
193+
<execution>
194+
<id>attach-sources</id>
195+
<goals>
196+
<goal>jar</goal>
197+
</goals>
198+
</execution>
199+
</executions>
200+
</plugin>
201+
<plugin>
202+
<groupId>org.apache.maven.plugins</groupId>
203+
<artifactId>maven-gpg-plugin</artifactId>
204+
<version>1.6</version>
205+
<executions>
206+
<execution>
207+
<id>sign-artifacts</id>
208+
<phase>verify</phase>
209+
<goals>
210+
<goal>sign</goal>
211+
</goals>
212+
</execution>
213+
</executions>
214+
</plugin>
215+
<plugin>
216+
<groupId>org.sonatype.plugins</groupId>
217+
<artifactId>nexus-staging-maven-plugin</artifactId>
218+
<version>1.6.8</version>
219+
<extensions>true</extensions>
220+
<configuration>
221+
<serverId>ossrh</serverId>
222+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
223+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
224+
</configuration>
225+
</plugin>
226+
</plugins>
227+
</build>
228+
</profile>
229+
</profiles>
112230
</project>

swan_core/src/main/java/de/fraunhofer/iem/swan/FeatureHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ private void addFeature(IFeature feature,
6969
*
7070
* @param disable indicates the id of the feature instance that should be excluded.
7171
* Used for the One-at-a-time analysis. 0 is for all features enables.
72-
*
73-
* @return The generated feature set.
7472
*/
7573
public void initializeFeatures(int disable) {
7674
featuresMap = new HashMap<Category, Set<IFeature>>();

swan_core/src/main/java/de/fraunhofer/iem/swan/FileUtility.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ public File getResourceFile(String resourceLocation) throws IOException {
109109
* this application's jar file. If it is not directly accessable from the
110110
* filesystem, it is copied to a temporary location.
111111
*
112-
* @param resourceLocation The location of the file within the jar file.
113-
* @param destinationDirectory The directory to place the file in, in case it
114-
* needs to be copied. If <code>null</code>, a new
115-
* temporary file is created and used.
112+
* @param resourceLocation The location of the file within the jar file.
113+
* @param destinationFile The destination to place the file, in case it needs
114+
* to be copied. If <code>null</code>, a new temporary
115+
* file is created and used.
116116
* @return The File describing the location of the provided file.
117117
* @throws IOException When an error occurs while copying the file.
118118
*/

swan_core/src/main/java/de/fraunhofer/iem/swan/Main.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,15 @@ public static void main(String[] args) {
8282

8383
private static final boolean runOAT = false; // run one at a time analysis
8484

85-
8685
/**
8786
* This method executes the analysis and can also be called from outside by
8887
* clients. It uses the builtin training data.
8988
*
90-
* @param sourceDir This is the actual user library being evaluated.
91-
* @param outputDir Directory where the output should be written.
92-
* @throws IOException In case an error occurs during the preparation or
93-
* execution of the analysis.
94-
* @throws InterruptedException
89+
* @param sourceDir This is the actual user library being evaluated.
90+
* @param outputDir Directory where the output should be written.
91+
* @throws IOException In case an error occurs during the preparation
92+
* or execution of the analysis.
93+
* @throws InterruptedException
9594
*/
9695
public void run(String sourceDir, String outputDir) throws IOException, InterruptedException {
9796
run(sourceDir, null, null, outputDir);
@@ -103,17 +102,18 @@ public void run(String sourceDir, String outputDir) throws IOException, Interrup
103102
*
104103
* @param sourceDir This is the actual user library being evaluated.
105104
* @param trainSourceCode Directory with all JAR Files or source code of the
106-
* Train Data to learn from. If this is <null>, then the
107-
* builtin traindata is used.
105+
* Train Data to learn from. If this is
106+
* <code>null</code>, then the builtin traindata is used.
108107
* @param trainJson Path to the train data file (JSON), which includes
109-
* method signatures.If this is <null>, then the builtin
110-
* json file is used.
108+
* method signatures.If this is <code>null</code>, then
109+
* the builtin json file is used.
111110
* @param outputDir Directory where the output should be written.
112-
* @throws IOException In case an error occurs during the preparation or
113-
* execution of the analysis.
114-
* @throws InterruptedException
111+
* @throws IOException In case an error occurs during the preparation
112+
* or execution of the analysis.
113+
* @throws InterruptedException
115114
*/
116-
public void run(String sourceDir, String trainSourceCode, String trainJson, String outputDir) throws IOException, InterruptedException {
115+
public void run(String sourceDir, String trainSourceCode, String trainJson, String outputDir)
116+
throws IOException, InterruptedException {
117117

118118
// This helper object keeps track of created temporary directories and files to
119119
// to be deleted before exiting the
@@ -240,7 +240,8 @@ private void internalRun(String sourceDir, String trainSourceCode, String trainJ
240240

241241
}
242242

243-
private double runClassifier(HashSet<Category> categories, boolean cweMode) throws IOException, InterruptedException {
243+
private double runClassifier(HashSet<Category> categories, boolean cweMode)
244+
throws IOException, InterruptedException {
244245
parser.resetMethods();
245246
loader.resetMethods();
246247
// System.out.println("***** Starting classification for " +

0 commit comments

Comments
 (0)