I'm currently struggling with the maven site plugin. I have a corporporate/ super pom (packaging type pom) which defines all dependency version and also configures the site plugin. In addition I placed some image resources under /src/site/resources/images which are referenced in a custom site.xml (for example ./images/logo.jpg).
Another module references this parent pom and when I call mvn site it seems that the site.xml is getting picked up. But unfortunately the links to the images do not work. When I had a look in the target/site folder the images were missing. I also tried to create an additional 'corporate' resource module where I put the site resources (also under /src/site/resources), and reference this module as a dependency in the maven-site-plugin like this:
<build><plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
<dependencies>
<dependency>
<groupId>de.il</groupId>
<artifactId>build-tools</artifactId>
<version>${build-tools.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>attach-descriptor</id>
<goals>
<goal>attach-descriptor</goal>
</goals>
</execution>
</executions>
<configuration>
<reportPlugins>
<plugin>
....
But this does not seem to work either. It worked for other reporting modules like pmd with special configurations which were placed under /src/main/resources though...the site resources does not seemed to be picked up and published to the repository.
So the question is: How is it possible to attach images and stylesheets to a maven super pom? I'm using Maven 3 btw...
Related
We're using in our project BlackDuck from Synopsis to identify the licenses of our used dependencies. There is actualy an small issue with Vaadin: When we build the frontend - based on Vaadin Core - in production mode the package.json is stuffed with a lot more dependencies than we use. And it includes also features from the pro-version. Since the detect-script for BlackDuck scans this package.json we get a lot of "false-positives". So is there a way of reducing the package.json to the only required dependencies by creating the build via Vaadin? As far as i could see the package.json will be always overwritten, when starting the build. Of course i can "hack" the package.json afterwards with a script, but this is not the way i look for.
Here is our profile for creating the "production ready" frontend sources:
<profile>
<id>production-mode</id>
<build>
<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-frontend</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
<configuration>
<productionMode>true</productionMode>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Thanks for your help in advance!
Update: This response was based on speculation rather than how things actually work.
The dependencies that Vaadin generates into package.json are based on the Java dependencies that are defined through Maven or Gradle.
If you want to have all the free components but want to avoid the commercial ones, then you can just change the com.vaadin:vaadin dependency to com.vaadin:vaadin-core. If you want to be even more granular, then you can either exclude the ones you don't want or build your own platform by including only the things you think you need out of the dependencies listed in https://mvnrepository.com/artifact/com.vaadin/vaadin-core/23.0.8.
Is anyone out there using OAuth to authenticate GeoServer users? I've been through installing and configuring this extension. I've tried Google and GitHub providers. I end up with a 404 error trying to access the login page. Same issue as here. There are no errors in the log with the debug level elevated as suggested.
Answering my own question here...
For me the 404 problem solved by building from source and accounting for the required dependencies using a maven plugin. Previously, I was attempting to use the prebuilt binaries and lib/ depedencies.
I built the modules from source (2.18.3) and modified the file maven file to copy the dependencies to the target folder, which I then copied to WEB-INF/lib.
Here is the pom file addition I made to get the dependencies.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Thanks to a Dropwizard Maven archetype I generated a sample Dropwizard Maven project. The pom.xml notably uses maven-source-plugin:
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
When I run "clean install" I have the following error :
Plugin org.apache.maven.plugins:maven-source-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-source-plugin:jar:2.4: Could not transfer artifact org.apache.maven.plugins:maven-source-plugin:pom:2.4 from/to central (http://repo.maven.apache.org/maven2): Connection refused: connect -> [Help 1]
The "maven-source-plugin" dependency is stored in the Nexus repository of my company. So I tried the adding of the plugin dependency between dependencies and /dependencies :
<dependencies>
...
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
but it did not correct the problem. I also tried to add the dependency at the call of the plugin :
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
</plugin>
but it did not work either
Two possible situations :
Your company uses a proxy to connect to the public Maven repository. Then ask someone in your company what the IP address of the proxy is then put it in your settings.xml file
Your company has its/their own Maven repository/ies (Nexus repository for example). Then ask someone in your company what the Nexus repository is then put it in your pom.xml or in your settings.xml. See Adding maven nexus repo to my pom.xml and https://maven.apache.org/guides/mini/guide-multiple-repositories.html
It may happen, e.g. after an interrupted download, that Maven cached a broken version of the referenced package in your local repository.
Solution: Manually delete the folder of this plugin from cache (i.e. your local repository), and repeat maven install.
How to find the right folder? Folders in Maven repository follow the structure:
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
</dependency>
is cached in ${USER_HOME}\.m2\repository\org\apache\maven\plugins\maven-source-plugin\2.4
Update the apache-maven-3.5.0-bin\apache-maven-3.5.0\conf\settings.xml file.
Check your internet explorer proxy --> Setting --> Internet explorer -->Connection --> LAN Setting
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>user</username>
<password>****</password>
<host>proxy</host>
<port>8080</port>
</proxy>
I am using JDK 7 for maven project and I used -Dhttps.protocols=TLSv1.2 as argument in JRE. It has allowed to download all maven repository which were failing earlier.
org.apache.maven.plugins:maven-source-plugin does not exist in the repository http://repo.maven.apache.org/maven2.
You have to download it from Maven central where it exists => maven-source-plugin
Verify your pom definition or your settings.xml file.
so I am assuming that this project you are doing in your private eclipse (not company provided eclipse where you work). The same problem I resolved just as below
quick fix : got to .m2 file --> create a backup of settings.xml --> remove settings.xml --> restart your eclipse.
On my side it was coming from an error in my settings.xml file.
I had a bad tag. Just removed it, refreshed and i was good to go.
Remove the content of the folder \.m2\repository\org\apache\maven\plugins\maven-resource-plugin\2.7. The cached info turned out to be the issue.
I use intelliJ and finally I created my own settings.xml and added the following content structure to it. In my project's pom.xml, the nexus repositories were defined but for some reason it was always hitting the external apache maven repo which is blocked in my company.
<settings>
<mirrors>
<id>nexus</id>
<url>nexusURL </url>
<mirrorOf>central</mirrorOf>
<mirror>
<profiles>
<profile>
<repositories>
<repository>
</settings>
Our team wants to use the wro4j tool, and we have gotten it setup and able to run the csslint and jslint. We would like to create our own custom CSS rules, but we can't find any documentation on where the csslint rules are stored and how to create our own.
Any help would be greatly appreciated.
In order to add csslint rules, you should update configuration options section of the maven plugin:
<plugins>
<plugin>
<groupid>ro.isdc.wro4j</groupid>
<artifactid>wro4j-maven-plugin</artifactid>
<version>${wro4j.version}</version>
<executions>
<execution>
<goals>
<goal>csslint</goal>
</goals>
</execution>
</executions>
<configuration>
<options>box-model</options>
</configuration>
</plugin>
</plugins>
More details are documented here.
Update:
The rules are defined by csslint library (version 0.9.10). All the rules defined in the library can be referred in the configuration section of the maven plugin. Adding custom rule is not supported out of the box, if you need this feature, feel free to create a feature request.
I have a initial data class which should be excluded in the normal (default profile) build. If I specify for example the run profile this class should be included.
Furthermore this class is needed by the tests. So it needs to be included all the tim.
I used the excludes to achieve the first part, but the dependency from the test breaks the testCompile goal.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<excludes>
<exclude>**/InitialDataBuilder.java</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<testIncludes>
<include>**/*.java</include>
</testIncludes>
</configuration>
</execution>
</executions>
</plugin>
What is wrong with my config?
Is there no way to include an excluded source file for tests?
Maven's directory structure allows you to easily separate source/production code and test code.
The details of how to layout a project are explained here: https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
Basically, you put your production code in:
src/main/java
Test code goes in:
src/test/java
The test code tree should include the actual unit tests themselves and supporting classes. So the code you described belongs there. It will only end up in the test jar, not the production jar.
Also if you do it this way, you don't need to mess with the compiler plugin settings. The defaults will do what you expect.
Oh one other thing I should mention is that if it is needed for another profile, you should likely make it it's own maven module with it's own POM file. Then this class can reference it as a <scope>test</scope> dependency and the other as a production dependency.