Skip to content

Commit 4376e12

Browse files
committed
Do not alter already signed jar
Fixes #1505
1 parent 6542bba commit 4376e12

File tree

3 files changed

+80
-75
lines changed

3 files changed

+80
-75
lines changed

Jenkinsfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
container('container') {
6060
withCredentials([string(credentialsId: "${GITHUB_API_CREDENTIALS_ID}", variable: 'GITHUB_API_TOKEN')]) {
6161
wrap([$class: 'Xvnc', useXauthority: true]) {
62-
sh """mvn clean verify -B -fae -Dtycho.disableP2Mirrors=true -Ddownload.cache.skip=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true ${env.BRANCH_NAME=='master' ? '-Psign': ''} -Dmaven.repo.local=$WORKSPACE/.m2/repository -Dgithub.api.token="${GITHUB_API_TOKEN}" """
62+
sh """mvn clean verify -B -fae -Dtycho.disableP2Mirrors=true -Ddownload.cache.skip=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Psign -Dmaven.repo.local=$WORKSPACE/.m2/repository -Dgithub.api.token="${GITHUB_API_TOKEN}" """
6363
}
6464
}
6565
}

org.eclipse.wildwebdeveloper/pom.xml

+65-7
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<goals>
3939
<goal>checkout</goal>
4040
</goals>
41-
<phase>process-sources</phase>
41+
<phase>generate-sources</phase>
4242
<configuration>
4343
<connectionUrl>scm:git:https://github.com/microsoft/vscode-eslint.git</connectionUrl>
4444
<scmVersionType>tag</scmVersionType>
@@ -55,7 +55,7 @@
5555
<executions>
5656
<execution>
5757
<id>fetch-vscode</id>
58-
<phase>generate-resources</phase>
58+
<phase>generate-sources</phase>
5959
<goals>
6060
<goal>wget</goal>
6161
</goals>
@@ -67,7 +67,7 @@
6767
</execution>
6868
<execution>
6969
<id>fetch-eslint-ls</id>
70-
<phase>generate-resources</phase>
70+
<phase>generate-sources</phase>
7171
<goals>
7272
<goal>wget</goal>
7373
</goals>
@@ -80,7 +80,7 @@
8080
</execution>
8181
<execution>
8282
<id>fetch-js-debug</id>
83-
<phase>generate-resources</phase>
83+
<phase>generate-sources</phase>
8484
<goals>
8585
<goal>wget</goal>
8686
</goals>
@@ -99,7 +99,7 @@
9999
<executions>
100100
<execution>
101101
<id>install-eslint-ls-package.json</id>
102-
<phase>process-resources</phase>
102+
<phase>process-sources</phase>
103103
<goals>
104104
<goal>copy-resources</goal>
105105
</goals>
@@ -147,7 +147,7 @@
147147
<goals>
148148
<goal>exec</goal>
149149
</goals>
150-
<phase>compile</phase>
150+
<phase>generate-resources</phase>
151151
<configuration>
152152
<executable>npm</executable>
153153
<arguments>
@@ -168,7 +168,7 @@
168168
<goals>
169169
<goal>exec</goal>
170170
</goals>
171-
<phase>compile</phase>
171+
<phase>process-resources</phase>
172172
<configuration>
173173
<executable>npm</executable>
174174
<arguments>
@@ -200,4 +200,62 @@
200200
</plugin>
201201
</plugins>
202202
</build>
203+
204+
<profiles>
205+
<profile>
206+
<id>sign</id>
207+
<build>
208+
<plugins>
209+
<plugin>
210+
<groupId>org.apache.maven.plugins</groupId>
211+
<artifactId>maven-antrun-plugin</artifactId>
212+
<dependencies>
213+
<dependency>
214+
<groupId>ant-contrib</groupId>
215+
<artifactId>ant-contrib</artifactId>
216+
<version>1.0b3</version>
217+
<exclusions>
218+
<exclusion>
219+
<groupId>ant</groupId>
220+
<artifactId>ant</artifactId>
221+
</exclusion>
222+
</exclusions>
223+
</dependency>
224+
</dependencies>
225+
<executions>
226+
<execution>
227+
<id>sign-node-files</id>
228+
<goals>
229+
<goal>run</goal>
230+
</goals>
231+
<phase>compile</phase>
232+
<configuration>
233+
<target>
234+
<!-- See last answer of https://stackoverflow.com/questions/4368243/maven-antrun-with-sequential-ant-contrib-fails-to-run/45958355 -->
235+
<!-- and http://ant-contrib.sourceforge.net/tasks/tasks/index.html -->
236+
<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath" />
237+
<for param="nodeFileAbsolute">
238+
<fileset dir="${project.basedir}/node_modules" includes="**/*.node" erroronmissingdir="false" />
239+
<sequential>
240+
<echo level="info" message="Mac-sign @{nodeFileAbsolute}" />
241+
<move file="@{nodeFileAbsolute}" tofile="@{nodeFileAbsolute}-tosign" />
242+
<exec executable="curl" dir="${project.build.directory}" failonerror="true">
243+
<arg value="-o" />
244+
<arg value="@{nodeFileAbsolute}" />
245+
<arg value="-F" />
246+
<arg value="file=@{nodeFileAbsolute}-tosign" />
247+
<arg value="https://cbi.eclipse.org/macos/codesign/sign" />
248+
</exec>
249+
<delete file="@{nodeFileAbsolute}-tosign" />
250+
</sequential>
251+
</for>
252+
</target>
253+
</configuration>
254+
</execution>
255+
</executions>
256+
</plugin>
257+
</plugins>
258+
</build>
259+
</profile>
260+
</profiles>
203261
</project>

pom.xml

+14-67
Original file line numberDiff line numberDiff line change
@@ -194,88 +194,35 @@
194194
<build>
195195
<plugins>
196196
<plugin>
197-
<groupId>org.apache.maven.plugins</groupId>
198-
<artifactId>maven-antrun-plugin</artifactId>
199-
<version>3.1.0</version>
200-
<dependencies>
201-
<dependency>
202-
<groupId>ant-contrib</groupId>
203-
<artifactId>ant-contrib</artifactId>
204-
<version>1.0b3</version>
205-
<exclusions>
206-
<exclusion>
207-
<groupId>ant</groupId>
208-
<artifactId>ant</artifactId>
209-
</exclusion>
210-
</exclusions>
211-
</dependency>
212-
</dependencies>
197+
<groupId>org.eclipse.cbi.maven.plugins</groupId>
198+
<artifactId>eclipse-jarsigner-plugin</artifactId>
199+
<version>1.4.3</version>
213200
<executions>
214201
<execution>
215-
<id>sign-node-files</id>
202+
<id>sign</id>
203+
<phase>package</phase>
216204
<goals>
217-
<goal>run</goal>
205+
<goal>sign</goal>
218206
</goals>
219-
<phase>package</phase> <!-- Do this before extracting sources-->
220-
<configuration>
221-
<target>
222-
<!-- See last answer of https://stackoverflow.com/questions/4368243/maven-antrun-with-sequential-ant-contrib-fails-to-run/45958355 -->
223-
<!-- and http://ant-contrib.sourceforge.net/tasks/tasks/index.html -->
224-
<taskdef resource="net/sf/antcontrib/antlib.xml"
225-
classpathref="maven.plugin.classpath" />
226-
<for param="jarFile">
227-
<fileset dir="${project.basedir}/target" includes="**/*.jar" />
228-
<sequential>
229-
<local name="jarFilename" />
230-
<basename property="jarFilename" file="@{jarFile}" suffix=".jar" />
231-
<local name="signingDir" />
232-
<property name="signingDir" value="${project.build.directory}/node-signing/${jarFilename}" />
233-
234-
<unzip src="@{jarFile}" dest="${signingDir}">
235-
<patternset includes="node_modules/**/*.node" />
236-
</unzip>
237-
238-
<for param="nodeFileAbsolute">
239-
<fileset dir="${signingDir}" includes="node_modules/**/*.node" erroronmissingdir="false" />
240-
<sequential>
241-
<echo level="info" message="Mac-sign @{nodeFileAbsolute}" />
242-
<local name="nodeFile" />
243-
<property name="nodeFile" value="@{nodeFileAbsolute}" relative="true" basedir="${signingDir}" />
244-
<move file="@{nodeFileAbsolute}" tofile="@{nodeFileAbsolute}-tosign" />
245-
<exec executable="curl" dir="${signingDir}" failonerror="true">
246-
<arg value="-o" />
247-
<arg value="${nodeFile}" />
248-
<arg value="-F" />
249-
<arg value="file=@${nodeFile}-tosign" />
250-
<arg value="https://cbi.eclipse.org/macos/codesign/sign" />
251-
</exec>
252-
<exec executable="jar" dir="${signingDir}" failonerror="true">
253-
<arg value="--update" />
254-
<arg value="--file=@{jarFile}" />
255-
<arg value="${nodeFile}" />
256-
</exec>
257-
</sequential>
258-
</for>
259-
</sequential>
260-
</for>
261-
</target>
262-
</configuration>
263207
</execution>
264208
</executions>
265209
</plugin>
266210
<plugin>
267-
<groupId>org.eclipse.cbi.maven.plugins</groupId>
268-
<artifactId>eclipse-jarsigner-plugin</artifactId>
269-
<version>1.4.3</version>
211+
<groupId>org.eclipse.tycho</groupId>
212+
<artifactId>tycho-p2-plugin</artifactId>
213+
<version>${tycho-version}</version>
270214
<executions>
271215
<execution>
272-
<id>sign</id>
216+
<id>p2-metadata</id>
273217
<phase>package</phase>
274218
<goals>
275-
<goal>sign</goal>
219+
<goal>p2-metadata</goal>
276220
</goals>
277221
</execution>
278222
</executions>
223+
<configuration>
224+
<defaultP2Metadata>false</defaultP2Metadata>
225+
</configuration>
279226
</plugin>
280227
</plugins>
281228
</build>

0 commit comments

Comments
 (0)