redhat-developer / redhat-developer/vscode-java
build-helper-maven-plugin on profile doesn't work
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 2.3k
- Fork
- 546
- Merge medio
- 20h 1m
- PR unite (30g)
- 11
Descrizione
[provide a description of the issue]
Dear support,
I am trying to use the profiles in a POM to add extra source directory.
I am using a plugin which generate java code in a custom directory target/generated-sources/plc4x and for telling VSC that this directory has sono code I would like to use build-helper-maven-plugin.
If I use the plugin inside the POM it works:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/plc4x</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
In this way VSC add correctly the new directory in the .classpath file:
<classpathentry kind="src" output="target/classes" path="target/generated-sources/plc4x">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
but if I try to use profiles to handle the plugin just in some circumstances, it doesn't work:
<profiles>
<profile>
<id>vsc</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/plc4x</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
In this way the entry in the .classpath file is not present.
Environment
- Operating System: Mac Os 11.2
- JDK version: openjdk version "13.0.2" 2020-01-14
- Visual Studio Code version: 1.53.0
Current Result
I can't use profiles to handle the build-helper-maven-plugin
Expected Result
To have the the path entry in the classpath in both the situation
Regards,
Stefano Bossi
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riprodurre le due configurazioni POM su macOS con le versioni di JDK e VS Code indicate, confrontando la voce .classpath generata quando build-helper-maven-plugin si trova sotto build rispetto a quando si trova in un profilo attivato dal sistema operativo. Iniziare dalla gestione dei profili Maven e dall'importazione dei progetti Java in VS Code; il lavoro è completato quando il percorso delle sorgenti generate appare in .classpath in entrambe le situazioni riportate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, vscode
- Ambito
- build-system, developer-experience
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100