[MSOURCES-95] Source JAR is re-created even if sources are not changed · apache/maven-source-plugin@6e715b1 (original) (raw)
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one | |
| 2 | +# or more contributor license agreements. See the NOTICE file | |
| 3 | +# distributed with this work for additional information | |
| 4 | +# regarding copyright ownership. The ASF licenses this file | |
| 5 | +# to you under the Apache License, Version 2.0 (the | |
| 6 | +# "License"); you may not use this file except in compliance | |
| 7 | +# with the License. You may obtain a copy of the License at | |
| 8 | +# | |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | +# | |
| 11 | +# Unless required by applicable law or agreed to in writing, | |
| 12 | +# software distributed under the License is distributed on an | |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 14 | +# KIND, either express or implied. See the License for the | |
| 15 | +# specific language governing permissions and limitations | |
| 16 | +# under the License. | |
| 17 | + | |
| 18 | +invoker.goals.1=${project.groupId}:${project.artifactId}:${project.version}:jar-no-fork project.groupId:{project.groupId}:project.groupId:{project.artifactId}:${project.version}:test-jar-no-fork | |
| 19 | +invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:jar-no-fork project.groupId:{project.groupId}:project.groupId:{project.artifactId}:${project.version}:test-jar-no-fork |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| 1 | + | |
| 2 | +<!-- | |
| 3 | + ~ Licensed to the Apache Software Foundation (ASF) under one | |
| 4 | + ~ or more contributor license agreements. See the NOTICE file | |
| 5 | + ~ distributed with this work for additional information | |
| 6 | + ~ regarding copyright ownership. The ASF licenses this file | |
| 7 | + ~ to you under the Apache License, Version 2.0 (the | |
| 8 | + ~ "License"); you may not use this file except in compliance | |
| 9 | + ~ with the License. You may obtain a copy of the License at | |
| 10 | + ~ | |
| 11 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | |
| 12 | + ~ | |
| 13 | + ~ Unless required by applicable law or agreed to in writing, | |
| 14 | + ~ software distributed under the License is distributed on an | |
| 15 | + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 16 | + ~ KIND, either express or implied. See the License for the | |
| 17 | + ~ specific language governing permissions and limitations | |
| 18 | + ~ under the License. | |
| 19 | + --> | |
| 20 | + | |
| 21 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 22 | +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 23 | +xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 " title="undefined" rel="noopener noreferrer">http://maven.apache.org/maven-4.0.0.xsd"\> | |
| 24 | + <modelVersion>4.0.0</modelVersion> | |
| 25 | + | |
| 26 | + <groupId>org.apache.maven.its.source</groupId> | |
| 27 | + <artifactId>empty-source-directory</artifactId> | |
| 28 | + <version>1.0-SNAPSHOT</version> | |
| 29 | + | |
| 30 | + <name>Test that empty source directory does not mark the JAR as outdated</name> | |
| 31 | + | |
| 32 | + <properties> | |
| 33 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
| 34 | + </properties> | |
| 35 | + | |
| 36 | + <build> | |
| 37 | + <plugins> | |
| 38 | + <plugin> | |
| 39 | + <groupId>org.apache.maven.plugins</groupId> | |
| 40 | + <artifactId>maven-source-plugin</artifactId> | |
| 41 | + <version>@project.version@</version> | |
| 42 | + </plugin> | |
| 43 | + </plugins> | |
| 44 | + </build> | |
| 45 | + | |
| 46 | +</project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one | |
| 2 | +# or more contributor license agreements. See the NOTICE file | |
| 3 | +# distributed with this work for additional information | |
| 4 | +# regarding copyright ownership. The ASF licenses this file | |
| 5 | +# to you under the Apache License, Version 2.0 (the | |
| 6 | +# "License"); you may not use this file except in compliance | |
| 7 | +# with the License. You may obtain a copy of the License at | |
| 8 | +# | |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | +# | |
| 11 | +# Unless required by applicable law or agreed to in writing, | |
| 12 | +# software distributed under the License is distributed on an | |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 14 | +# KIND, either express or implied. See the License for the | |
| 15 | +# specific language governing permissions and limitations | |
| 16 | +# under the License. | |
| 17 | + | |
| 18 | +# This file is added just because git does not support | |
| 19 | +# empty directories and we need empty directory for the test. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one | |
| 2 | +# or more contributor license agreements. See the NOTICE file | |
| 3 | +# distributed with this work for additional information | |
| 4 | +# regarding copyright ownership. The ASF licenses this file | |
| 5 | +# to you under the Apache License, Version 2.0 (the | |
| 6 | +# "License"); you may not use this file except in compliance | |
| 7 | +# with the License. You may obtain a copy of the License at | |
| 8 | +# | |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | +# | |
| 11 | +# Unless required by applicable law or agreed to in writing, | |
| 12 | +# software distributed under the License is distributed on an | |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 14 | +# KIND, either express or implied. See the License for the | |
| 15 | +# specific language governing permissions and limitations | |
| 16 | +# under the License. | |
| 17 | + |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one | |
| 2 | +# or more contributor license agreements. See the NOTICE file | |
| 3 | +# distributed with this work for additional information | |
| 4 | +# regarding copyright ownership. The ASF licenses this file | |
| 5 | +# to you under the Apache License, Version 2.0 (the | |
| 6 | +# "License"); you may not use this file except in compliance | |
| 7 | +# with the License. You may obtain a copy of the License at | |
| 8 | +# | |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | +# | |
| 11 | +# Unless required by applicable law or agreed to in writing, | |
| 12 | +# software distributed under the License is distributed on an | |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 14 | +# KIND, either express or implied. See the License for the | |
| 15 | +# specific language governing permissions and limitations | |
| 16 | +# under the License. | |
| 17 | + | |
| 18 | +# This file is added just because git does not support | |
| 19 | +# empty directories and we need empty directory for the test. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one | |
| 2 | +# or more contributor license agreements. See the NOTICE file | |
| 3 | +# distributed with this work for additional information | |
| 4 | +# regarding copyright ownership. The ASF licenses this file | |
| 5 | +# to you under the Apache License, Version 2.0 (the | |
| 6 | +# "License"); you may not use this file except in compliance | |
| 7 | +# with the License. You may obtain a copy of the License at | |
| 8 | +# | |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | +# | |
| 11 | +# Unless required by applicable law or agreed to in writing, | |
| 12 | +# software distributed under the License is distributed on an | |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 14 | +# KIND, either express or implied. See the License for the | |
| 15 | +# specific language governing permissions and limitations | |
| 16 | +# under the License. | |
| 17 | + |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| 1 | +/* | |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one | |
| 3 | + * or more contributor license agreements. See the NOTICE file | |
| 4 | + * distributed with this work for additional information | |
| 5 | + * regarding copyright ownership. The ASF licenses this file | |
| 6 | + * to you under the Apache License, Version 2.0 (the | |
| 7 | + * "License"); you may not use this file except in compliance | |
| 8 | + * with the License. You may obtain a copy of the License at | |
| 9 | + * | |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 11 | + * | |
| 12 | + * Unless required by applicable law or agreed to in writing, | |
| 13 | + * software distributed under the License is distributed on an | |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 15 | + * KIND, either express or implied. See the License for the | |
| 16 | + * specific language governing permissions and limitations | |
| 17 | + * under the License. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +File buildLog = new File( basedir, 'build.log' ) | |
| 21 | + | |
| 22 | +String sourcesJarFileName = 'empty-source-directory-1.0-SNAPSHOT-sources.jar' | |
| 23 | +String testSourcesJarFileName = "empty-source-directory-1.0-SNAPSHOT-test-sources.jar" | |
| 24 | + | |
| 25 | +assert buildLog.exists() | |
| 26 | + | |
| 27 | +// Make sure the jars are created on the first build | |
| 28 | +assert buildLog.text =~ /(?i) Building jar: .*${sourcesJarFileName}/ | |
| 29 | +assert buildLog.text =~ /(?i) Building jar: .*${testSourcesJarFileName}/ | |
| 30 | + | |
| 31 | +// Make sure the jars are not re-created on subsequent builds | |
| 32 | +assert buildLog.text =~ /(?i) Archive .*${sourcesJarFileName} is uptodate/ | |
| 33 | +assert buildLog.text =~ /(?i) Archive .*${testSourcesJarFileName} is uptodate/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -50,7 +50,7 @@ | ||
| 50 | 50 | public abstract class AbstractSourceJarMojo |
| 51 | 51 | extends AbstractMojo |
| 52 | 52 | { |
| 53 | -private static final String[] DEFAULT_INCLUDES = new String[] { "**/*" }; | |
| 53 | +private static final String[] DEFAULT_INCLUDES = new String[] { "**/**" }; | |
| 54 | 54 | |
| 55 | 55 | private static final String[] DEFAULT_EXCLUDES = new String[] {}; |
| 56 | 56 |