|
79 | 79 | </dependencies> |
80 | 80 |
|
81 | 81 | <build> |
82 | | - <resources> |
83 | | - <resource> |
84 | | - <filtering>false</filtering> |
85 | | - <directory>${project.build.directory}/generated-resources</directory> |
86 | | - </resource> |
87 | | - </resources> |
88 | 82 | <plugins> |
89 | 83 | <plugin> |
90 | 84 | <groupId>org.apache.maven.plugins</groupId> |
|
110 | 104 | <goals> |
111 | 105 | <goal>unpack-dependencies</goal> |
112 | 106 | </goals> |
113 | | - <phase>generate-resources</phase> |
| 107 | + <phase>prepare-package</phase> |
114 | 108 | <configuration> |
115 | 109 | <includeArtifactIds>maven-resolver-transport-jdk-8</includeArtifactIds> |
116 | | - <outputDirectory>${project.build.directory}/generated-resources</outputDirectory> |
| 110 | + <excludeClassifiers>sources</excludeClassifiers> |
| 111 | + <outputDirectory>${project.build.outputDirectory}</outputDirectory> |
117 | 112 | <excludes>META-INF/maven/**</excludes> |
118 | 113 | </configuration> |
119 | 114 | </execution> |
|
122 | 117 | <goals> |
123 | 118 | <goal>unpack-dependencies</goal> |
124 | 119 | </goals> |
125 | | - <phase>generate-resources</phase> |
| 120 | + <phase>prepare-package</phase> |
126 | 121 | <configuration> |
127 | 122 | <includeArtifactIds>maven-resolver-transport-jdk-11</includeArtifactIds> |
128 | | - <outputDirectory>${project.build.directory}/generated-resources/META-INF/versions/11</outputDirectory> |
| 123 | + <excludeClassifiers>sources</excludeClassifiers> |
| 124 | + <outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory> |
129 | 125 | <includes>**/*.class</includes> |
130 | 126 | </configuration> |
131 | 127 | </execution> |
132 | 128 | </executions> |
133 | 129 | </plugin> |
134 | 130 | </plugins> |
135 | 131 | </build> |
| 132 | + |
| 133 | + <profiles> |
| 134 | + <profile> |
| 135 | + <id>apache-release</id> |
| 136 | + <dependencies> |
| 137 | + <dependency> |
| 138 | + <groupId>org.apache.maven.resolver</groupId> |
| 139 | + <artifactId>maven-resolver-transport-jdk-11</artifactId> |
| 140 | + <version>${project.version}</version> |
| 141 | + <classifier>sources</classifier> |
| 142 | + <optional>true</optional> |
| 143 | + </dependency> |
| 144 | + </dependencies> |
| 145 | + <build> |
| 146 | + <plugins> |
| 147 | + <plugin> |
| 148 | + <groupId>org.apache.maven.plugins</groupId> |
| 149 | + <artifactId>maven-dependency-plugin</artifactId> |
| 150 | + <executions> |
| 151 | + <execution> |
| 152 | + <id>java11-sources</id> |
| 153 | + <goals> |
| 154 | + <goal>unpack-dependencies</goal> |
| 155 | + </goals> |
| 156 | + <phase>prepare-package</phase> |
| 157 | + <configuration> |
| 158 | + <includeArtifactIds>maven-resolver-transport-jdk-11</includeArtifactIds> |
| 159 | + <includeClassifiers>sources</includeClassifiers> |
| 160 | + <outputDirectory>${project.build.directory}/generated-sources</outputDirectory> |
| 161 | + <includes>**/*.java</includes> |
| 162 | + </configuration> |
| 163 | + </execution> |
| 164 | + </executions> |
| 165 | + </plugin> |
| 166 | + <plugin> |
| 167 | + <groupId>org.codehaus.mojo</groupId> |
| 168 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 169 | + <executions> |
| 170 | + <execution> |
| 171 | + <id>add-source</id> |
| 172 | + <goals> |
| 173 | + <goal>add-source</goal> |
| 174 | + </goals> |
| 175 | + <phase>prepare-package</phase> |
| 176 | + <configuration> |
| 177 | + <sources> |
| 178 | + <source>${project.build.directory}/generated-sources</source> |
| 179 | + </sources> |
| 180 | + </configuration> |
| 181 | + </execution> |
| 182 | + </executions> |
| 183 | + </plugin> |
| 184 | + </plugins> |
| 185 | + </build> |
| 186 | + </profile> |
| 187 | + </profiles> |
136 | 188 | </project> |
0 commit comments