Index: IdeaModuleMojo.java =================================================================== --- IdeaModuleMojo.java (revision 599652) +++ IdeaModuleMojo.java (working copy) @@ -948,15 +948,34 @@ return null; } + String type = artifact.getType(); + boolean testSources = "test-jar".equals(type) && "sources".equals(classifier); + if (testSources) + { + // test-jar sources are really a combined classifier: test-sources accordining to wagon + type = "jar"; + classifier = "test-sources"; + } + List remoteRepos = executedProject.getRemoteArtifactRepositories(); try { Artifact classifiedArtifact = artifactFactory.createArtifactWithClassifier( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), - artifact.getType(), + type, classifier ); - String dstFilename = basePath.substring( 0, delIndex ) + '-' + classifier + ".jar"; + String dstFilename; + if (testSources) + { + // since the classifier and type have changed, remove -tests from the destination file name + // so we can append -test-sources + dstFilename = basePath.substring( 0, delIndex - 6 ) + '-' + classifier + ".jar"; + } + else + { + dstFilename = basePath.substring( 0, delIndex ) + '-' + classifier + ".jar"; + } File dstFile = new File( dstFilename ); classifiedArtifact.setFile( dstFile ); //this check is here because wagonManager does not seem to check if the remote file is newer