Skip to content

Commit 339579f

Browse files
committed
WIP use of a fat jar (camel-tooling#11)
- changed project to provide a fat jar but: -- it used 0.7.0 as I wasn't able to find a wsdl2rest with all dependencies available on provided repositories -- folder where the jar is provided needs to be customized (currently using the target one...) -- the generation is not working because I think that parameters have been changed between 0.7.0 and 0.8.0 and I didn't adapt them back - it avoids to duplicate all dependencies - it simplifies the command line to launch Signed-off-by: Aurélien Pupier <[email protected]>
1 parent 2fee1fa commit 339579f

File tree

3 files changed

+33
-360
lines changed

3 files changed

+33
-360
lines changed

Diff for: generators/wsdl2rest/index.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,18 @@ module.exports = class extends Generator {
4949
writing() {
5050
app: {
5151
var userProps = this.props;
52-
var platformDelimiter = ':';
53-
if (process.platform === 'win32')
54-
platformDelimiter = ';';
5552

56-
var mainClass = 'org.jboss.fuse.wsdl2rest.impl.Main';
57-
var libDir = path.join(__dirname, 'lib');
58-
var jarDir = path.join(libDir, 'wsdl2rest-impl.jar');
53+
var targetDir = path.join(__dirname, 'target');
54+
var jar = path.join(targetDir, 'wsdl2rest-impl-fatjar-0.1.1-SNAPSHOT.jar');
5955
var log4jDir = path.join(__dirname, 'config', 'logging.properties');
6056
var log4jDirStr = String(log4jDir);
6157
var log4jDirUrl = fileUrl(log4jDirStr);
6258
var outPath = path.join(process.cwd(), userProps.outdirectory);
6359

6460
// build the java command with classpath, class name, and the passed parameters
6561
var cmdString = 'java';
62+
cmdString = cmdString + ' -jar ' + jar;
6663
cmdString = cmdString + ' -Dlog4j.configuration=' + log4jDirUrl;
67-
cmdString = cmdString + ' -cp ' + jarDir + platformDelimiter +
68-
libDir + '\\*' + platformDelimiter + '. ' + mainClass;
6964
cmdString = cmdString + ' --wsdl ' + userProps.wsdl;
7065
cmdString = cmdString + ' --out ' + outPath;
7166

Diff for: generators/wsdl2rest/pom.xml

+30-206
Original file line numberDiff line numberDiff line change
@@ -3,220 +3,44 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
44
<modelVersion>4.0.0</modelVersion>
55

6-
<artifactId>org.fusesource.ide.wsdl2rest</artifactId>
7-
<!-- <packaging>eclipse-plugin</packaging> -->
8-
<name>Red Hat Fuse Tooling :: Camel Editor :: Plugins :: Wsdl2Rest Implementation</name>
6+
<artifactId>wsdl2rest-impl-fatjar</artifactId>
7+
<name>Wsdl2Rest Fat Jar</name>
98
<version>0.1.1-SNAPSHOT</version>
10-
<groupId>org.fusesource.yeoman.wsdl2rest</groupId>
9+
<groupId>org.github.camel.tooling.wsdl2rest</groupId>
1110

1211
<properties>
13-
<!-- <version.apache.camel>2.21.0</version.apache.camel> -->
14-
<version.apache.camel>2.21.0.fuse-720006</version.apache.camel>
15-
<version.apache.cxf>3.1.11</version.apache.cxf>
16-
<version.apache.velocity>1.7</version.apache.velocity>
17-
<version.eclipse.jetty>9.4.6.v20170531</version.eclipse.jetty>
18-
<version.args4j>2.33</version.args4j>
19-
<version.javaparser>2.5.1</version.javaparser>
20-
<version.javax.ws.rs.api>2.1</version.javax.ws.rs.api>
21-
<version.junit>4.12</version.junit>
22-
<version.wsdl4j>1.6.3</version.wsdl4j>
23-
<version.wsdl2rest>0.8.0.fuse-720006</version.wsdl2rest>
12+
<!-- <version.wsdl2rest>0.8.0.fuse-710018</version.wsdl2rest> -->
13+
<version.wsdl2rest>0.7.0</version.wsdl2rest>
2414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2515
</properties>
2616

27-
<dependencyManagement>
28-
<dependencies>
29-
<dependency>
30-
<groupId>org.apache.camel</groupId>
31-
<artifactId>camel-parent</artifactId>
32-
<version>${version.apache.camel}</version>
33-
<scope>import</scope>
34-
<type>pom</type>
35-
</dependency>
36-
</dependencies>
37-
</dependencyManagement>
38-
3917
<dependencies>
40-
<dependency>
41-
<groupId>args4j</groupId>
42-
<artifactId>args4j</artifactId>
43-
<version>${version.args4j}</version>
44-
</dependency>
45-
<dependency>
46-
<groupId>com.github.javaparser</groupId>
47-
<artifactId>javaparser-core</artifactId>
48-
<version>${version.javaparser}</version>
49-
</dependency>
50-
<dependency>
51-
<groupId>org.apache.camel</groupId>
52-
<artifactId>camel-spring</artifactId>
53-
</dependency>
54-
<dependency>
55-
<groupId>org.apache.cxf</groupId>
56-
<artifactId>cxf-codegen-plugin</artifactId>
57-
<version>${version.apache.cxf}</version>
58-
</dependency>
59-
<dependency>
60-
<groupId>org.apache.cxf</groupId>
61-
<artifactId>cxf-rt-rs-extension-providers</artifactId>
62-
<version>${version.apache.cxf}</version>
63-
</dependency>
64-
<dependency>
65-
<groupId>org.apache.cxf</groupId>
66-
<artifactId>cxf-rt-transports-http-jetty</artifactId>
67-
<version>${version.apache.cxf}</version>
68-
</dependency>
69-
<dependency>
70-
<groupId>org.apache.cxf</groupId>
71-
<artifactId>cxf-tools-common</artifactId>
72-
<version>${version.apache.cxf}</version>
73-
</dependency>
74-
<dependency>
75-
<groupId>org.apache.velocity</groupId>
76-
<artifactId>velocity</artifactId>
77-
<version>${version.apache.velocity}</version>
78-
</dependency>
79-
<dependency>
80-
<groupId>wsdl4j</groupId>
81-
<artifactId>wsdl4j</artifactId>
82-
<version>${version.wsdl4j}</version>
83-
</dependency>
84-
<dependency>
85-
<groupId>javax.ws.rs</groupId>
86-
<artifactId>javax.ws.rs-api</artifactId>
87-
<version>${version.javax.ws.rs.api}</version>
88-
</dependency>
89-
<dependency>
90-
<groupId>org.slf4j</groupId>
91-
<artifactId>slf4j-api</artifactId>
92-
</dependency>
93-
<dependency>
94-
<groupId>org.slf4j</groupId>
95-
<artifactId>slf4j-log4j12</artifactId>
96-
<!-- Add in scope compile so it ends up in the manifest Class-Path -->
97-
</dependency>
98-
<dependency>
99-
<groupId>log4j</groupId>
100-
<artifactId>log4j</artifactId>
101-
</dependency>
18+
<dependency>
19+
<groupId>org.jboss.fuse.wsdl2rest</groupId>
20+
<artifactId>wsdl2rest-impl</artifactId>
21+
<version>${version.wsdl2rest}</version>
22+
</dependency>
10223
</dependencies>
10324

10425
<build>
105-
<plugins>
106-
<plugin>
107-
<groupId>org.apache.maven.plugins</groupId>
108-
<artifactId>maven-dependency-plugin</artifactId>
109-
<version>3.1.1</version>
110-
<executions>
111-
<execution>
112-
<id>unpack-wsdl2rest</id>
113-
<phase>generate-sources</phase>
114-
<goals>
115-
<goal>unpack</goal>
116-
</goals>
117-
<configuration>
118-
<stripVersion>true</stripVersion>
119-
<outputDirectory>${project.build.directory}/unpack/</outputDirectory>
120-
<skip>false</skip>
121-
<artifactItems>
122-
<!-- Impl -->
123-
<artifactItem>
124-
<groupId>org.jboss.fuse.wsdl2rest</groupId>
125-
<artifactId>wsdl2rest-dist</artifactId>
126-
<version>${version.wsdl2rest}</version>
127-
<type>zip</type>
128-
<overWrite>true</overWrite>
129-
<includes>**/lib/,**/config/</includes>
130-
</artifactItem>
131-
</artifactItems>
132-
</configuration>
133-
</execution>
134-
<execution>
135-
<id>copy-wsdl2rest</id>
136-
<phase>generate-resources</phase>
137-
<goals>
138-
<goal>copy</goal>
139-
</goals>
140-
<configuration>
141-
<stripVersion>true</stripVersion>
142-
<outputDirectory>${basedir}/lib/</outputDirectory>
143-
<skip>false</skip>
144-
<artifactItems>
145-
<!-- Impl -->
146-
<artifactItem>
147-
<groupId>org.jboss.fuse.wsdl2rest</groupId>
148-
<artifactId>wsdl2rest-impl</artifactId>
149-
<version>${version.wsdl2rest}</version>
150-
</artifactItem>
151-
<!-- Util -->
152-
<artifactItem>
153-
<groupId>org.jboss.fuse.wsdl2rest</groupId>
154-
<artifactId>wsdl2rest-util</artifactId>
155-
<version>${version.wsdl2rest}</version>
156-
</artifactItem>
157-
</artifactItems>
158-
</configuration>
159-
</execution>
160-
<execution>
161-
<id>copy-dependencies</id>
162-
<phase>generate-sources</phase>
163-
<goals>
164-
<goal>copy-dependencies</goal>
165-
</goals>
166-
<configuration>
167-
<outputDirectory>${basedir}/lib/</outputDirectory>
168-
<resources>
169-
<resource>
170-
<directory>${basedir}/unpack/*/lib/</directory>
171-
<filtering>true</filtering>
172-
</resource>
173-
</resources>
174-
</configuration>
175-
</execution>
176-
</executions>
177-
</plugin>
178-
<plugin>
179-
<groupId>org.apache.maven.plugins</groupId>
180-
<artifactId>maven-clean-plugin</artifactId>
181-
<version>3.1.0</version>
182-
<configuration>
183-
<filesets>
184-
<fileset>
185-
<directory>${basedir}/lib</directory>
186-
<includes>
187-
<include>*</include>
188-
</includes>
189-
<followSymlinks>false</followSymlinks>
190-
</fileset>
191-
<fileset>
192-
<directory>${basedir}/lib</directory>
193-
<followSymlinks>false</followSymlinks>
194-
</fileset>
195-
<fileset>
196-
<directory>${basedir}</directory>
197-
<includes>
198-
<include>**/*.log</include>
199-
</includes>
200-
<followSymlinks>false</followSymlinks>
201-
</fileset>
202-
</filesets>
203-
</configuration>
204-
</plugin>
205-
<plugin>
206-
<groupId>org.apache.maven.plugins</groupId>
207-
<artifactId>maven-enforcer-plugin</artifactId>
208-
<version>1..4.1</version>
209-
<executions>
210-
<execution>
211-
<id>ban-uberjars</id>
212-
<configuration>
213-
<skip>true</skip>
214-
</configuration>
215-
</execution>
216-
</executions>
217-
</plugin>
218-
</plugins>
219-
</build>
26+
<plugins>
27+
<plugin>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-maven-plugin</artifactId>
30+
<version>2.0.4.RELEASE</version>
31+
<executions>
32+
<execution>
33+
<goals>
34+
<goal>repackage</goal>
35+
</goals>
36+
</execution>
37+
</executions>
38+
<configuration>
39+
<mainClass>org.jboss.fuse.wsdl2rest.impl.Main</mainClass>
40+
</configuration>
41+
</plugin>
42+
</plugins>
43+
</build>
22044

22145
<repositories>
22246
<repository>
@@ -256,7 +80,7 @@
25680
<url>https://maven.repository.redhat.com/earlyaccess/all</url>
25781
</repository>
25882
<!-- To remove when a long-term version will be available -->
259-
<repository>
83+
<repository>
26084
<releases>
26185
<enabled>true</enabled>
26286
<updatePolicy>never</updatePolicy>
@@ -271,7 +95,7 @@
27195
</repositories>
27296

27397
<pluginRepositories>
274-
<pluginRepository>
98+
<pluginRepository>
27599
<id>fuse-public-repository</id>
276100
<name>FuseSource Community Release Repository</name>
277101
<url>https://repo.fusesource.com/nexus/content/groups/public</url>

0 commit comments

Comments
 (0)