Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 5b8666b

Browse files
committed
[maven-release-plugin] copy for tag appassembler-1.8.1
git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/tags/appassembler-1.8.1@19877 52ab4f32-60fc-0310-b215-8acea882cd1b
2 parents 369bc42 + a13a52d commit 5b8666b

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

appassembler-maven-plugin/src/it/programNameDuplicateTest/verify.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ println "ProjectVersion:" + projectVersion
5353

5454
def buildLogFile = new File( basedir, "build.log");
5555

56-
if (mavenVersion.equals("3.0.4") || mavenVersion.equals("3.0.5") || mavenVersion.equals( "3.1.0" ) || mavenVersion.equals( "3.1.1" ) || mavenVersion.equals( "3.2.1" ) || mavenVersion.equals( "3.2.2" )) {
56+
//All Maven 3.X versions
57+
if (mavenVersion.startsWith("3.")) {
5758
t.checkExistenceAndContentOfAFile(buildLogFile, [
5859
'[ERROR] Failed to execute goal org.codehaus.mojo:appassembler-maven-plugin:' + projectVersion + ':assemble (default) on project programNameDuplicate-test: The program id: program-01-test exists more than once! -> [Help 1]',
5960
]);
6061
} else {
62+
//Maven 2.X output looks different...
6163
t.checkExistenceAndContentOfAFile(buildLogFile, [
6264
'org.apache.maven.BuildFailureException: The program id: program-01-test exists more than once!',
6365
]);

appassembler-maven-plugin/src/main/java/org/codehaus/mojo/appassembler/daemon/script/DefaultScriptGenerator.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public void createBinScript( String platformName, Daemon daemon, File outputDire
165165
FileWriter out = null;
166166
File binFile;
167167

168-
169168
try
170169
{
171170
in = getScriptTemplate( platformName, daemon );
@@ -239,21 +238,24 @@ public void createBinScript( String platformName, Daemon daemon, File outputDire
239238
binFile = new File( binDir, programName + platform.getBinFileExtension() );
240239
if ( Platform.UNIX_NAME.equals( platformName ) )
241240
{
242-
try
243-
{
244-
// in case it already exists, make it writable. Maybe deleting would be better?
245-
ArchiveEntryUtils.chmod( binFile, 0777, getLogger(), true );
246-
}
247-
catch ( ArchiverException ae )
241+
// Only in case of an existing file it does make sense
242+
if ( binFile.exists() )
248243
{
249-
// give up
244+
try
245+
{
246+
// in case it already exists, make it writable. Maybe deleting would be better?
247+
ArchiveEntryUtils.chmod( binFile, 0777, getLogger(), true );
248+
}
249+
catch ( ArchiverException ae )
250+
{
251+
throw new DaemonGeneratorException( "Failed to change permission for bin file.", ae );
252+
}
250253
}
251254
}
252255

253-
254256
out = new FileWriter( binFile );
255-
getLogger().debug(
256-
"Writing shell file for platform '" + platform.getName() + "' to '" + binFile.getAbsolutePath() + "'." );
257+
getLogger().debug( "Writing shell file for platform '" + platform.getName() + "' to '"
258+
+ binFile.getAbsolutePath() + "'." );
257259

258260
IOUtil.copy( interpolationFilterReader, out );
259261
}
@@ -275,11 +277,12 @@ public void createBinScript( String platformName, Daemon daemon, File outputDire
275277
{
276278
try
277279
{
278-
ArchiveEntryUtils.chmod( binFile, 0555, getLogger(), true );
280+
// TODO: The permissions should be made configurable.
281+
ArchiveEntryUtils.chmod( binFile, 0755, getLogger(), true );
279282
}
280283
catch ( ArchiverException ae )
281284
{
282-
// give up.
285+
throw new DaemonGeneratorException( "Failed to change permission for bin file.", ae );
283286
}
284287
}
285288
}

0 commit comments

Comments
 (0)