Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions src/site/apt/examples/configureplugin.apt.vm

This file was deleted.

83 changes: 0 additions & 83 deletions src/site/apt/index.apt.vm

This file was deleted.

117 changes: 0 additions & 117 deletions src/site/apt/usage.apt.vm

This file was deleted.

45 changes: 45 additions & 0 deletions src/site/markdown/examples/configureplugin.md.vm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Configuring Source Plugin

To customize the plugin, you can change its configuration parameters in your POM, as shown below:

```xml
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<outputDirectory>/absolute/path/to/the/output/directory</outputDirectory>
<finalName>filename-of-generated-jar-file</finalName>
<attach>false</attach>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
```

The generated jar file will be named by the value of the `finalName` plus "-sources" if it is the main sources. Otherwise, it would be `finalName` plus "-test-sources" if it is the test sources. It will be generated in the specified `outputDirectory`. The `attach` parameter specifies whether the java sources will be attached to the artifact list of the project.
48 changes: 48 additions & 0 deletions src/site/markdown/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Apache Maven Source Plugin
The Source Plugin creates a jar archive of the source files of the current project. The jar file is, by default, created in the project's target directory.

## Important Hint

Starting with version 3.0.0 of the plugin all properties which could be used via command line have been named based on the following schema **maven.source.\***. Further details can be found in the goal documentations.

## Goals Overview

The Source Plugin has five goals:

- [source:aggregate](./aggregate-mojo.html) aggregrates sources for all modules in an aggregator project.
- [source:jar](./jar-mojo.html) is used to bundle the main sources of the project into a jar archive.
- [source:test-jar](./test-jar-mojo.html) on the other hand, is used to bundle the test sources of the project into a jar archive.
- [source:jar-no-fork](./jar-no-fork-mojo.html) is similar to **jar** but does not fork the build lifecycle.
- [source:test-jar-no-fork](./test-jar-no-fork-mojo.html) is similar to **test-jar** but does not fork the build lifecycle.
## Usage

General instructions on how to use the Source Plugin can be found on the [usage page](./usage.html). Some more specific use cases are described in the examples given below.

In case you still have questions regarding the plugin's usage, please have a look at the [FAQ](./faq.html) and feel free to contact the [user mailing list](./mailing-lists.html). The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the [mail archive](./mailing-lists.html).

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our [issue tracker](./issue-management.html). When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our [source repository](./scm.html) and will find supplementary information in the [guide to helping with Maven](http://maven.apache.org/guides/development/guide-helping.html).

## Examples

To provide you with better understanding on some usages of the Source plugin, you can take a look into the following examples:

- [Configuring Source Plugin](./examples/configureplugin.html)
Loading
Loading